You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NAME DOCKER REF LABELS
sha256:01eed3f3b8c323b6074c77256c82c7fb94293ff35c65bdde93a21bbcd4bad358 centos/ruby-24-centos7@sha256:01eed3f3b8c323b6074c77256c82c7fb94293ff35c65bdde93a21bbcd4bad358
Expected Result
NAME DOCKER REF LABELS
sha256:01eed3f3b8c323b6074c77256c82c7fb94293ff35c65bdde93a21bbcd4bad358 centos/ruby-24-centos7@sha256:01eed3f3b8c323b6074c77256c82c7fb94293ff35c65bdde93a21bbcd4bad358 foo=bar
P.S. custom-columns doesn't help
This is the kind of thing where custom-columns could be friendlier than go templates, but alas it fails if any of the images has no labels. Is it because of omitempty and jsonpath expressions not handling nil? I found no way to explicitly iterate over a map, nor a way to explicitly check for nil.
Is this why --show-labels was important in the first place?
$ oc get images -o 'custom-columns=NAME:.metadata.name,DOCKER REF:.dockerImageReference,LABELS:.metadata.labels'
error: labels is not found
$ oc get images -o 'custom-columns=NAME:.metadata.name,DOCKER REF:.dockerImageReference,LABELS:.metadata.labels' sha256:01eed3f3b8c323b6074c77256c82c7fb94293ff35c65bdde93a21bbcd4bad358
NAME DOCKER REF LABELS
sha256:01eed3f3b8c323b6074c77256c82c7fb94293ff35c65bdde93a21bbcd4bad358 centos/ruby-24-centos7@sha256:01eed3f3b8c323b6074c77256c82c7fb94293ff35c65bdde93a21bbcd4bad358 map[foo:bar]
The text was updated successfully, but these errors were encountered:
Automatic merge from submit-queue.
Add labels column to `oc get images --show-labels` output
Fixes#17736
This is my first code contribution to the project. Please let me know if I missed anything or if I should have branched off of a release instead of master.
--show-labels
works for most resource types but not images — it only adds aLABELS
headers but doesn't actually add a column with labels.Version
oc v3.7.0+7ed6862
kubernetes v1.7.6+a08f5eeb62
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://192.168.99.100:8443
openshift v3.7.0+7ed6862
kubernetes v1.7.6+a08f5eeb62
(via minishift 1.9.0)
Steps To Reproduce
Current Result
Expected Result
P.S. custom-columns doesn't help
This is the kind of thing where
custom-columns
could be friendlier than go templates, but alas it fails if any of the images has no labels. Is it because ofomitempty
and jsonpath expressions not handling nil? I found no way to explicitly iterate over a map, nor a way to explicitly check for nil.Is this why
--show-labels
was important in the first place?The text was updated successfully, but these errors were encountered: