Bug 1656328 - 'oc describe machineset' show labels in wrong format
Summary: 'oc describe machineset' show labels in wrong format
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 4.1.0
Assignee: Maciej Szulik
QA Contact: Yadan Pei
URL:
Whiteboard:
: 1586343 1698235 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-05 09:20 UTC by Yadan Pei
Modified: 2019-06-04 10:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: All labels and annotation were treated as regular strings and camel cased. Consequence: The output of labels and annotations following kubernetes.io or k8s.io format where wrongly printed. Fix: Ignore strings containing .io when camel casing. Result: The output contains correct output for these data.
Clone Of:
Environment:
Last Closed: 2019-06-04 10:41:04 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0758 0 None None None 2019-06-04 10:41:10 UTC

Description Yadan Pei 2018-12-05 09:20:02 UTC
Description of problem:
We can't simply copy the labels from output of "oc describe machineset" to get machines associated with it

Version-Release number of selected component (if applicable):
oc v4.0.0-0.82.0
kubernetes v1.11.0+6855010f70
features: Basic-Auth GSSAPI Kerberos SPNEGO
kubernetes v1.11.0+81b29ee


How reproducible:
Always

Steps to Reproduce:
1. Get all machinesets in the cluster
oc get machinesets --all-namespaces
.....skipped....
2. User 'oc get' to get the selector
$ oc get machineset qe-chuyu-worker-us-east-1a -n openshift-cluster-api -o yaml | grep -i match.*label -A 8 -B 1
  selector:
    matchLabels:
      sigs.k8s.io/cluster-api-cluster: qe-chuyu
      sigs.k8s.io/cluster-api-machineset: qe-chuyu-worker-us-east-1a
  template:
    metadata:
      creationTimestamp: null
      labels:
        sigs.k8s.io/cluster-api-cluster: qe-chuyu
        sigs.k8s.io/cluster-api-machine-role: worker
 
3.Use 'oc describe' to get the selector
$ oc describe machineset qe-chuyu-worker-us-east-1a -n openshift-cluster-api | grep -i match.*label -A 8 -B 1
  Selector:
    Match Labels:
      Sigs . K 8 S . Io / Cluster - API - Cluster:     qe-chuyu
      Sigs . K 8 S . Io / Cluster - API - Machineset:  qe-chuyu-worker-us-east-1a
  Template:
    Metadata:
      Creation Timestamp:  <nil>
      Labels:
        Sigs . K 8 S . Io / Cluster - API - Cluster:         qe-chuyu
        Sigs . K 8 S . Io / Cluster - API - Machine - Role:  worker

Actual results:
3. We can see the output of 'oc describe' is not user friendly, we can't copy and use it directly with command 'oc get machine --selector=key1=value1,key2=value2' to get all machines associated with this MachineSet

Expected results:
3. Labels in 'oc describe' output should be in right format, such as the output of 'oc get -o yaml'

Additional info:

Comment 2 Maciej Szulik 2019-02-28 20:44:12 UTC
Fix in https://github.com/openshift/origin/pull/22198

Comment 4 Maciej Szulik 2019-04-09 14:41:00 UTC
*** Bug 1586343 has been marked as a duplicate of this bug. ***

Comment 5 Kirsten Garrison 2019-04-10 16:37:57 UTC
*** Bug 1698235 has been marked as a duplicate of this bug. ***

Comment 6 Yadan Pei 2019-04-29 06:57:59 UTC
// using `oc get -o yaml` to get machinesets labels
$ oc get machinesets -n openshift-machine-api gpei-0429-pgvnx-worker-us-east-2a -o yaml | grep -i match.*label -A 8 -B 1
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: gpei-0429-pgvnx
      machine.openshift.io/cluster-api-machineset: gpei-0429-pgvnx-worker-us-east-2a
  template:
    metadata:
      creationTimestamp: null
      labels:
        machine.openshift.io/cluster-api-cluster: gpei-0429-pgvnx
        machine.openshift.io/cluster-api-machineset: gpei-0429-pgvnx-worker-us-east-2a

// using `oc describe` to get machinesets labels
$ oc describe machinesets -n openshift-machine-api gpei-0429-pgvnx-worker-us-east-2a | grep -i match.*label -A 8 -B 1
  Selector:
    Match Labels:
      machine.openshift.io/cluster-api-cluster:     gpei-0429-pgvnx
      machine.openshift.io/cluster-api-machineset:  gpei-0429-pgvnx-worker-us-east-2a
  Template:
    Metadata:
      Creation Timestamp:  <nil>
      Labels:
        machine.openshift.io/cluster-api-cluster:     gpei-0429-pgvnx
        machine.openshift.io/cluster-api-machineset:  gpei-0429-pgvnx-worker-us-east-2a

the labels are shown in correct format, move to VERIFIED

Verified on
oc version
Client Version: version.Info{Major:"4", Minor:"1+", GitVersion:"v4.1.0", GitCommit:"f19fc6a99", GitTreeState:"clean", BuildDate:"2019-04-28T17:00:00Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.4+438fe5b", GitCommit:"438fe5b", GitTreeState:"clean", BuildDate:"2019-04-25T11:05:03Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}

Comment 8 errata-xmlrpc 2019-06-04 10:41:04 UTC
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:0758


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