-
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
Fix kubectl unlabel
response msg
#104372
Fix kubectl unlabel
response msg
#104372
Conversation
Hi @astraw99. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/sig cli |
/lgtm Thanks! |
@rikatz Any update on this? Waiting for your update, thanks. |
@@ -393,6 +393,9 @@ func updateDataChangeMsg(oldObj []byte, newObj []byte) string { | |||
msg := "not labeled" | |||
if !reflect.DeepEqual(oldObj, newObj) { | |||
msg = "labeled" | |||
if len(newObj) < len(oldObj) { | |||
msg = "unlabeled" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the label key?
eg: 'labelkey' unlabeled
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the kubectl label
response is like node/10.0.x.x labeled/unlabeled
, it is the same as node/10.0.x.x tainted/untainted
.
So if want to add the label key, there need more code change.
Hello @astraw99 @rikatz I think label command can provide more exact response msg. Like this: $ kubectl label pod apple-app foo=bar
pod/apple-app labeled
$ kubectl label pod apple-app foo=bar --overwrite
pod/apple-app not labeled
$ kubectl label pod apple-app foo=bar1 --overwrite
pod/apple-app labeled
$ kubectl label pod apple-app foofoo=barbar foo-
pod/apple-app labeled & unlabeled
$ kubectl label pod apple-app foofoo-
pod/apple-app unlabeled
I submitted a PR for this. Hopefully understand it correctly. Thanks. |
@rikatz PTAL thanks. |
@soltysh PTAL thanks. |
Have you added the unit tests? Thanks! |
d98989b
to
cec30fd
Compare
@rikatz Unit tests added and passed, PTAL thanks. |
2 similar comments
/lgtm Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/priority backlog
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: astraw99, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This looks like a flake? Don't see an open issue but will make one if it passes
and testgrid |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
What type of PR is this?
/kind bug
What this PR does / why we need it:
To distinguish between label and unlabel msg:
labeled/unlabeled
, just liketainted/untainted
.Which issue(s) this PR fixes:
Fixes #104371
Does this PR introduce a user-facing change?