-
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
kubectl annotate patches too much #49044
Comments
@MikeSpreitzer
Note: Method 1 will trigger an email to the group. You can find the group list here and label list here. |
@kubernetes/sig-cli-bugs |
@MikeSpreitzer: Reiterating the mentions to trigger a notification: In response to this:
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. |
Can you provide the step to reproduce? |
Just make a pod, then $ kubectl --v=10 annotate pods $podname bar=foo |
The root cause is that when creating a patch for merge, nil value will be considered as different value. That's why Will create a PR to vendor when evanphx/json-patch #45 gets merged. |
Automatic merge from submit-queue (batch tested with PRs 49259, 49350) update json-patch to fix nil value issue when creating mergepatch **What this PR does / why we need it**: When [creating a patch for merge](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/annotate.go#L255), nil value will be considered as different value. This has been fixed and merged in [evanphx/json-patch #45](evanphx/json-patch#45). **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #49044 **Special notes for your reviewer**: /cc @MikeSpreitzer @mengqiy **Release note**: ```release-note Fix nil value issue when creating json patch for merge ```
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
I used
kubectl --v=10 annotate
to learn about patching object metadata, and was surprised to find more than the metadata in the PATCH request body. Here is an example:What you expected to happen:
I expected to see my new annotation, but not the pod's status, in the request body.
How to reproduce it (as minimally and precisely as possible):
I hope the above makes this clear.
Anything else we need to know?:
Environment:
kubectl version
): 1.6.4 in client and serveruname -a
): 4.4.0-34-genericThe text was updated successfully, but these errors were encountered: