kubernetes-sigs / kustomize

Customization of kubernetes YAML configurations
Apache License 2.0
10.71k stars 2.22k forks source link

`kustomize edit add label` generates deprecated config #5726

Open mhutter opened 4 days ago

mhutter commented 4 days ago

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

k8s-ci-robot commented 4 days ago

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.