Bug 1268877
| Summary: | [RFE] oc label doesn't have an option to show labels | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Erik M Jacobs <ejacobs> |
| Component: | oc | Assignee: | Maciej Szulik <maszulik> |
| Status: | CLOSED ERRATA | QA Contact: | Xingxing Xia <xxia> |
| Severity: | low | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.0.0 | CC: | aos-bugs, dmcphers, jokerman, mmccomas |
| Target Milestone: | --- | Keywords: | Rebase, UpcomingRelease |
| Target Release: | 3.11.z | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: |
Feature:
Be able to list labels on a resource.
Reason:
Understand labels present on a resource.
Result:
oc label --list resource/name shows all the labels.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-04-11 05:38:22 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Erik M Jacobs
2015-10-05 13:52:24 UTC
Upstream PR: https://github.com/kubernetes/kubernetes/pull/51971 Upstream PR has merged, marking this as UpcomingRelease, Rebase Checked oc v3.9.0-0.19.0 `oc label -h` now has `--list`, and generally it works: $ oc label dc/ruby-ex --list app=ruby-ex $ oc label po ruby-ex-2-649cc --list app=ruby-ex deployment=ruby-ex-2 deploymentconfig=ruby-ex However, it is not perfect for multiple resources: $ oc label dc ruby-ex aosqe-ho --list app=ruby-ex app=aosqe-ho It should add preceding resource names like `oc set env --list` for multiple resources: $ oc set env dc ruby-ex aosqe-ho --list # deploymentconfigs ruby-ex, container ruby-ex NEW_ENV2=new_value2 # deploymentconfigs aosqe-ho, container aosqe-ho NEW_ENV1=new_value1 Please check Opened upstream PR for this. Marking as upcoming release. https://github.com/kubernetes/kubernetes/pull/58353 New output for `oc labels --list` will include the resource kind/name before each set of labels belonging to that specific resource: $ oc label ... dc dc_one dc_two --list Listing labels for dc/dc_one: label1=one Listing labels for dc/dc_two: label2=two oc label --list pod/name is a thing for quite a while already, moving to QA. (In reply to Xingxing Xia from comment #4) > However, it is not perfect for multiple resources: > $ oc label dc ruby-ex aosqe-ho --list > app=ruby-ex > app=aosqe-ho This still exists in latest 3.9 oc 3.9.71 and 3.10 oc 3.10.118. Fixed in 3.11 oc 3.11.86: 3.11/oc label dc registry-console router --list Listing labels for DeploymentConfig.apps.openshift.io/registry-console: createdBy=registry-console-template name=registry-console Listing labels for DeploymentConfig.apps.openshift.io/router: router=router Since bug is low AND no versioned advisory attached, IMO target field can be changed. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2019:0636 |