Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
seh opened this issue Apr 4, 2024 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@seh
Copy link
Contributor

seh commented Apr 4, 2024

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
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

@seh seh added the kind/bug Categorizes issue or PR as related to a bug. label Apr 4, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 4, 2024
@jefferybradberry
Copy link

It also shows this way:

$ kustomize version
unknown

@stormqueen1990
Copy link
Member

/triage accepted
/kind bug

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 4, 2024
@stormqueen1990
Copy link
Member

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
Copy link
Contributor Author

seh commented Apr 4, 2024

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 #5644).

@seh seh closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants