-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Upgrade StatefulSet, key missing in env #122121
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/area kubectl |
@kubernetes/sig-cli-kubectl-maintainers |
@liggitt Could you please take a look? |
/sig apps |
Duplicate of #121541. |
/sig cli |
This is a duplicate of #58477 Use of env var entries with duplicate names is not recommended, and breaks the name-keyed list when using apply (duplicates are removed). The recommended solution is to stop adding env var entries with duplicate names. Use of duplicate envvar entries has emitted warnings since 1.22. |
Note that server-side apply handles this case better, by removing duplicates but not removing all entries. |
What happened?
There are two versions of StatefulSet resources as follows:
sts-1.yaml has duplicate keys, e.g.: key-1
sts-2.yaml has no duplicate keys:
Do the following:
1、kubectl create -f sts-2.yaml
kubectl get sts busybox -oyaml :
The sts env are as follows:
2、kubectl apply -f sts-1.yaml
kubectl get sts busybox -oyaml :
The sts env are as follows:
3、kubectl apply -f sts-2.yaml
kubectl get sts busybox -oyaml :
The env
key-1
disappeared this time, but there is a missing env in the annotationkubectl.kubernetes.io/last-applied-configuration
What did you expect to happen?
There should be env
key-1
in the third step.How can we reproduce it (as minimally and precisely as possible)?
Refer to
What happened?
step descriptionAnything else we need to know?
No response
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: