`kustomize edit add label` generates deprecated config
What happened?
How to reproduce:
kustomize edit add label environment:dev
This will set commonLabels.env in the kustomization file, triggering a deprecation warning.
What did you expect to happen?
Kustomize commands to not generate deprecated configs.
How can we reproduce it (as minimally and precisely as possible)?
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Expected output
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: true
pairs:
environment: dev
Actual output
# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
commonLabels:
environment: dev
Kustomize version
5.4.2
Operating system
Linux
This is not exactly a bug, but I agree that since Kustomize is deprecating commonLabels, it should either provide a new command that creates configuration in the new, non-deprecated format, or update the existing command to do so. In the meantime, kustomize edit fix can be used to transform the previous format of label configuration into the new format.
/triage accepted /remove-kind bug /kind deprecation /kind cleanup
/lifecycle frozen
Hello, @stormqueen1990.
Is there any plan or guidance for implementing a CLI command for the new options?
Thanks!
Hello, @stormqueen1990.
Is there any plan or guidance for implementing a CLI command for the new options?
Thanks!
Hi there, @daengdaengLee! We currently have PR #5741 in the works that will enable creation of labels under the labels section once merged.