kubernetes-sigs / kustomize

Customization of kubernetes YAML configurations
Apache License 2.0
10.94k stars 2.24k forks source link

Value of the "app.kubernetes.io/managed-by" field no longer mentions actual version #5642

Closed seh closed 5 months ago

seh commented 5 months ago

What happened?

For kustomizations that opt to include the "app.kubernetes.io/managed-by" label by way of the following stanza,

buildMetadata:
- managedByLabel

kustomize does inject the label, but its value no longer mentions the actual kustomize version name. Instead, the label's value winds up "kustomize-unknown".

This appears to be a problem with how we capture the version name and stamp it into the program for use with this lable.

What did you expect to happen?

The resulting manifests should include a member in the "metadata.labels" field named "app.kubernetes.io/managed-by" with a value such as "kustomize-v5.4.0".

How can we reproduce it (as minimally and precisely as possible)?

kustomization.yaml file ```yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization configMapGenerator: - name: example literals: - one=uno - two=dos buildMetadata: - managedByLabel ```

Expected output

apiVersion: v1
data:
  one: uno
  two: dos
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/managed-by: kustomize-5.4.0
  name: example-t85cb8kk54

Actual output

apiVersion: v1
data:
  one: uno
  two: dos
kind: ConfigMap
metadata:
  labels:
    app.kubernetes.io/managed-by: kustomize-unknown
  name: example-t85cb8kk54

Kustomize version

5.4.0

Operating system

MacOS

jefferybradberry commented 5 months ago

It also shows this way:

$ kustomize version
unknown
stormqueen1990 commented 5 months ago

/triage accepted /kind bug

stormqueen1990 commented 5 months ago

The kustomize version issue was resolved today with the release of Kustomize 5.4.1: https://github.com/kubernetes-sigs/kustomize/releases/tag/kustomize%2Fv5.4.1

Could you please confirm whether the issue still happens with the YAML rendering?

seh commented 5 months ago

Could you please confirm whether the issue still happens with the YAML rendering?

Yes, that fixed the problem. The field value now includes the kustomize version name.

Thank you for addressing this problem so quickly (presumably by way of kubernetes-sigs/kustomize#5644).