Improvement for annotation removal output is needed
What happened:
When we add an annotation the output shows:
pod/<pod-name> annotated
but this is the same output we get after we remove this annotation
What you expected to happen:
The output should be
'pod/
How to reproduce it (as minimally and precisely as possible):
- Create a pod named
my-pod2 . add annotation to the pod
$ kubectl annotate pod my-pod set-url=http://goo.gl/XXBTWQq
pod/my-pod annotated
- Check the annotation using
kubectl describe pod my-pod - remove the annotation using
$ kubectl annotate pod my-pod set-url-
pod/my-pod annotated
- Check the annotation which will show this is removed .
Anything else we need to know?:
Environment:
- Kubernetes client and server versions (use
kubectl version): - - Cloud provider or hardware configuration: any
- OS (e.g:
cat /etc/os-release): any
/sig cli /area kubectl
I would be happy to contribute the change if this bug is not intentional or redundant.
This is a duplicate of the issues referenced in https://github.com/kubernetes/kubernetes/pull/110124. Currently, it requires some refactoring in the code base to achieve this.
Hi @ardaguclu thanks for the information, I didn't see that PR. However it seem that this issue will still persist even if thePR is merged.
const (
MsgAnnotationUnchanged = "annotation(s) unchanged" // no change
MsgAnnotationModified = "annotation(s) modified" // support ADD, DEL and ADD && DEL scenarios
)
This shows that both Add and Delete scenarios are still covered with one Message here as well.
if this gets changed to two messages i.e, MsgAnnotationAdded MsgAnnotationDeleted that will be great.
/triage accepted
/assign