Bug 1332498 - oc get --show-labels option cannot show labels for project
Summary: oc get --show-labels option cannot show labels for project
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-03 10:53 UTC by Meng Bo
Modified: 2016-09-19 13:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:49:51 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Meng Bo 2016-05-03 10:53:36 UTC
Description of problem:
Try to get the labels of the resource via oc get command with --show-labels option.

Cannot show the project labels.


Version-Release number of selected component (if applicable):
oc v1.3.0-alpha.0-267-gcd62e58

How reproducible:
always

Steps to Reproduce:
1. Create project by user1
2. Add label to the namespace via cluster-admin
3. Try to get the labels on project
$ oc get project --show-labels

Actual results:
Labels cannot be shown for project.

Expected results:
Should show correct labels.

Additional info:
[user1@master ~]$ oc get namespace u1p1 --show-labels 
NAME      STATUS    AGE       LABELS
u1p1      Active    4d        team=red,ttt=1,tttt=1234
[user1@master ~]$ oc get project u1p1 --show-labels 
NAME      DISPLAY NAME   STATUS    LABELS
u1p1                     Active
[user1@master ~]$ oc get project -l team=red
NAME      DISPLAY NAME   STATUS
u1p1                     Active

[user1@master ~]$ oc get project u1p1 -o yaml
apiVersion: v1
kind: Project
metadata:
  annotations:
    openshift.io/description: ""
    openshift.io/display-name: ""
    openshift.io/requester: user1
    openshift.io/sa.scc.mcs: s0:c6,c5
    openshift.io/sa.scc.supplemental-groups: 1000040000/10000
    openshift.io/sa.scc.uid-range: 1000040000/10000
  creationTimestamp: 2016-04-29T06:08:04Z
  labels:
    team: red
    ttt: "1"
    tttt: "1234"
  name: u1p1
  resourceVersion: "76322"
  selfLink: /oapi/v1/projects/u1p1
  uid: bc7b88ef-0dd0-11e6-a87a-525400efed30
spec:
  finalizers:
  - openshift.io/origin
  - kubernetes
status:
  phase: Active

Comment 1 Juan Vallejo 2016-08-10 21:31:10 UTC
This bug has been fixed by PR: https://github.com/openshift/origin/pull/10329

Comment 2 Meng Bo 2016-08-12 03:05:29 UTC
Verify fixed on build v1.3.0-alpha.3+9852956-dirty

[root@master ~]# oc get project --show-labels 
NAME              DISPLAY NAME   STATUS    LABELS
openshift-infra                  Active    <none>
default                          Active    project=admin
kube-system                      Active    <none>
openshift                        Active    <none>


Note You need to log in before you can comment on or make changes to this bug.