Merge pull request #51971 from juanvallejo/jvallejo/add-list-option-to-kubectl-label
Automatic merge from submit-queue (batch tested with PRs 52485, 52443, 52597, 52450, 51971). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..
add --list option to label cmd
**Release note**:
```release-note
added --list option to the `kubectl label` command
```
Adds a `--list` option to `kubectl label ...` with similar behavior to `kubectl env ... --list`
**Before**
```
$ kubectl label pod/mypod --list
Error: unknown flag: --list
Usage:
...
```
**After**
```
$ kubectl label pod/mypod --list
labelkey1=existinglabel1
labelkey2=existinglabel2
$ kubectl label pod/mypod --list label1=newlabel1
labelkey1=existinglabel1
labelkey2=existinglabel2
label1=newlabel1
```
Related downstream bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1268877
cc @fabianofranz @kubernetes/sig-cli-misc
Showing
Please
register
or
sign in
to comment