Open KnVerey opened 1 year ago
Although there is no direct relation but to distinguish label/unlabel
message also causing this issue https://github.com/kubernetes/kubectl/issues/1265 as a symptom. If we decide to just say modified
, this issue will also be fixed.
Got it, will fix it in PR https://github.com/kubernetes/kubernetes/pull/110124
/triage accepted /priority backlog /assign @astraw99
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
This issue has not been updated in over 1 year, and should be re-triaged.
You can:
/triage accepted
(org members only)/close
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/
/remove-triage accepted
/assign
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
What happened:
What you expected to happen:
kubectl
label should produce a consistent, accurate message when labels are both removed and added at the same time (maybe just "labels modified" for simplicity?).How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?: The problem seems to be the use of a length comparison in this function: https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubectl/pkg/cmd/label/label.go#L399-L408. That might be reliable if labels could only be added OR removed by an operation, but as in the examples above, both are possible at once.
Environment:
kubectl version
):Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.2", GitCommit:"5835544ca568b757a8ecae5c153f317e5736700e", GitTreeState:"clean", BuildDate:"2022-09-21T14:25:45Z", GoVersion:"go1.19.1", Compiler:"gc", Platform:"darwin/arm64"}
cat /etc/os-release
): n/a/sig cli
Fixed by https://github.com/kubernetes/kubernetes/pull/110124