Bug 1698687 - Must-gather tool gathers wrong objects from image registry
Summary: Must-gather tool gathers wrong objects from image registry
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.1.0
Assignee: Maciej Szulik
QA Contact: wewang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-11 02:12 UTC by wewang
Modified: 2019-06-04 10:47 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: must-gather was not using full resource name, including api group. Consequence: Some resources have similar names, but reside in different group. Failing to specify group lead to picking wrong resource. Fix: Always specify full resource (group + resource name) when reading objects. Result: Gathering data works correctly.
Clone Of:
Environment:
Last Closed: 2019-06-04 10:47:22 UTC
Target Upstream Version:


Attachments (Terms of Use)


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

Description wewang 2019-04-11 02:12:05 UTC
Description of problem:
must-gather tool collect logs: "images.image.openshift.io "cluster" not found" from image-registry, it's not correct. we just defined one cluster called images.config.openshift.io/cluster  

Version-Release number of selected component (if applicable):
clusterverson: 4.0.0-0.ci-2019-04-10-002527

payload: registry.svc.ci.openshift.org/ocp/release@sha256:9a8a2f66c5d4b63bedc6ff3a0b5d692ff5dc310254d098cc29bda1527a255689

How reproducible:
always

Steps to Reproduce:
[wewang@Desktop must-gather]$  ./openshift-must-gather inspect clusteroperator/image-registry
    2019/04/10 17:42:10 Gathering config.openshift.io resource data...
    2019/04/10 17:42:16 Gathering kubeapiserver.operator.openshift.io resource data...
    2019/04/10 17:42:16 Gathering cluster operator resource data...
    2019/04/10 17:42:16     Gathering related object reference information for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "system:registry" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "registry-registry-role" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "registry" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "image-registry-certificates" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "image-registry-private-configuration" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "cluster" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "node-ca" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "image-registry" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "image-registry" for ClusterOperator "image-registry"...
    2019/04/10 17:42:16     Found related object "myroute" for ClusterOperator "image-registry"...
    Error: images.image.openshift.io "cluster" not found



Actual results:
Should not have about Error: images.image.openshift.io "cluster" not found


Expected results:
Should not have the error

Additional info:
FYI, logs already have cluster info:     2019/04/10 17:42:16     Found related object "cluster" for ClusterOperator "image-registry"...

Comment 2 Maciej Szulik 2019-04-17 11:55:42 UTC
Fixed in https://github.com/openshift/must-gather/pull/76

Comment 3 wewang 2019-04-22 07:02:44 UTC
Now no error info, but I found duplicated info, @Maciej Szulik @Oleg Bulatov do you think if it's acceptable? 

[wewang@Desktop must-gather]$ ./openshift-must-gather  inspect clusteroperator/image-registry
2019/04/22 14:55:38 Gathering config.openshift.io resource data...
2019/04/22 14:55:39 Gathering kubeapiserver.operator.openshift.io resource data...
2019/04/22 14:55:39 Gathering cluster operator resource data...
2019/04/22 14:55:39     Gathering related object reference information for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "system:registry" for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "registry-registry-role" for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "registry" for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "image-registry-certificates" for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "image-registry-private-configuration" for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "cluster" for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "node-ca" for ClusterOperator "image-registry"...
2019/04/22 14:55:39     Found related object "image-registry" for ClusterOperator "image-registry"...                           ## the same info with below line
2019/04/22 14:55:39     Found related object "image-registry" for ClusterOperator "image-registry"...                           ##
2019/04/22 14:55:53 Finished successfully with no errors.

Comment 4 Maciej Szulik 2019-04-24 12:13:09 UTC
This is not a duplication, if you look into oc get clusteroperator/image-registry -o yaml output
you'll notice there are 2 image-registry resources:

  - group: ""
    name: image-registry
    namespace: openshift-image-registry
    resource: services
  - group: apps
    name: image-registry
    namespace: openshift-image-registry
    resource: deployments


it just happens that both are named the same. I've crafted https://github.com/openshift/must-gather/pull/77
which will make the output more explicit, but that's not a bug per se.

Comment 5 wewang 2019-04-25 02:04:19 UTC
Ok, Thank you, verify it now.

Comment 7 errata-xmlrpc 2019-06-04 10:47:22 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.