Bug 1723672 - [marketplace] Specify right owner kind in child resources' labels
Summary: [marketplace] Specify right owner kind in child resources' labels
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.2.0
Assignee: lgallett
QA Contact: Fan Jia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-06-25 06:38 UTC by Fan Jia
Modified: 2019-10-16 06:32 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:32:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:32:36 UTC

Description Fan Jia 2019-06-25 06:38:13 UTC
Description of problem:
Currently the csc label is propagated to child resources created by opsrc which wrongly informs that these child resources were created by csc when they were created by an opsrc. 

Version-Release number of selected component (if applicable):
cv: 4.2.0-0.nightly-2019-06-24-160709
marketplace: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:86b40723079613bca637e91f45252c52774738cbebb0c98f288a8bd833ec1251
commit: 1cbd326243493ff9ec589a542fa335fdc84dc3e7

How reproducible:
always

Steps to Reproduce:
1.install a cluster
2.create an opsrc by yaml
###########
apiVersion: "operators.coreos.com/v1"
kind: "OperatorSource"
metadata:
  name: "testkey"
  namespace: "openshift-marketplace"
  labels:
    opsrc-provider: testkey
spec:
  type: appregistry
  endpoint: "https://quay.io/cnr"
  registryNamespace: "jfan"
  displayName: "testkey"
  publisher: "testkey"
#############

Actual results:
1.after step 2 the child resources created by opsrc :”catalogsource,service,deployment,replicaset,pod” have the labels about csc

# oc describe catalogsource testkey | grep csc
Labels:       csc-owner-name=testkey
              csc-owner-namespace=openshift-marketplace


# oc describe service testkey | grep csc
Labels:            csc-owner-name=testkey
                   csc-owner-namespace=openshift-marketplace

# oc describe deployment testkey | grep csc
Labels:                 csc-owner-name=testkey
                        csc-owner-namespace=openshift-marketplace

# oc describe pod testkey-59f64fd6b6-ghckx
Name:               testkey-59f64fd6b6-ghckx
Namespace:          openshift-marketplace
Labels:             marketplace.catalogSourceConfig=testkey


# oc describe replicaset testkey-59f64fd6b6
Name:           testkey-59f64fd6b6
Namespace:      openshift-marketplace
Selector:       marketplace.catalogSourceConfig=testkey,pod-template-hash=59f64fd6b6
Labels:         marketplace.catalogSourceConfig=testkey

Expected results:
1.should change the label from “csc” to “opsrc” for the child resources created by opsrcs

Additional info:

Comment 1 Fan Jia 2019-07-18 10:02:56 UTC
test env:

4.2.0-0.nightly-2019-07-18-032637

test result:

1.check the opsrc "redhat-operators" child resource , the owner lables of resources from opsrc:

1)$ oc describe catalogsource redhat-operators | grep "owner"
opsrc-owner-name=redhat-operators
opsrc-owner-namespace=openshift-marketplace
2)$ oc describe service redhat-operators | grep "owner"
Labels: opsrc-owner-name=redhat-operators
opsrc-owner-namespace=openshift-marketplace
3)$ oc describe deployment redhat-operators | grep "owner"
Labels: opsrc-owner-name=redhat-operators
opsrc-owner-namespace=openshift-marketplace

2.create a csc "simplecsc" and check the owner lables of resources from csc:

1)$ oc describe deployment simplecsc | grep "owner"
Labels: csc-owner-name=simplecsc
csc-owner-namespace=openshift-marketplace
2)$ oc describe service simplecsc | grep "owner"
Labels: csc-owner-name=simplecsc
csc-owner-namespace=openshift-marketplace
3)$ oc describe catalogsource simplecsc -n openshift-operators | grep "owner"
Labels: csc-owner-name=simplecsc
csc-owner-namespace=openshift-marketplace

Comment 2 errata-xmlrpc 2019-10-16 06:32:26 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:2922


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