Bug 1938618

Summary: ClusterServiceVersion property inference does not infer package and version
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: OLMAssignee: Kevin Rizza <krizza>
OLM sub component: OLM QA Contact: kuiwang
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: bluddy, ecordell, jiazha, krizza, scuppett, tflannag, vdinh
Version: 4.6Keywords: Triaged
Target Milestone: ---   
Target Release: 4.6.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-30 17:03:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1929904    
Bug Blocks:    

Comment 2 kuiwang 2021-03-22 02:07:20 UTC
verify it on 4.6. lgtm

--
[root@preserve-olm-env 1938618]# oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-0.nightly-2021-03-21-131139   True        False         13m     Cluster version is 4.6.0-0.nightly-2021-03-21-131139
[root@preserve-olm-env 1938618]# oc get pod -n openshift-operator-lifecycle-manager
NAME                                READY   STATUS    RESTARTS   AGE
catalog-operator-5b4f4bdc66-lcqxr   1/1     Running   0          42m
olm-operator-7fdf8cbd9-cbxw9        1/1     Running   0          42m
packageserver-646c856c84-4xhxp      1/1     Running   0          35m
packageserver-646c856c84-sp9gk      1/1     Running   0          35m
[root@preserve-olm-env 1938618]# oc exec catalog-operator-5b4f4bdc66-lcqxr -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.16.1
git commit: 2cd064dba8bd60baa573af531970e6e567048f2b
[root@preserve-olm-env 1938618]# cat res.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: ibm-common-service-catalog
  namespace: default
spec:
  image: docker.io/ibmcom/ibm-common-service-catalog:latest
  sourceType: grpc
---
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: ibm-operator-catalog
  namespace: default
spec:
  image: docker.io/ibmcom/ibm-operator-catalog:latest
  sourceType: grpc
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: test-operator-group
  namespace: default
spec: {}
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: test-ibm-common-service-operator
  namespace: default
spec:
  channel: stable-v1
  installPlanApproval: Automatic
  name: ibm-common-service-operator
  source: ibm-common-service-catalog
  sourceNamespace: default

[root@preserve-olm-env 1938618]# kubectl create -f res.yaml
catalogsource.operators.coreos.com/ibm-common-service-catalog created
catalogsource.operators.coreos.com/ibm-operator-catalog created
operatorgroup.operators.coreos.com/test-operator-group created
subscription.operators.coreos.com/test-ibm-common-service-operator created
[root@preserve-olm-env 1938618]# kubectl get csv
NAME                                 DISPLAY                              VERSION   REPLACES                             PHASE
ibm-common-service-operator.v3.6.3   IBM Cloud Platform Common Services   3.6.3     ibm-common-service-operator.v3.6.2   Succeeded
[root@preserve-olm-env 1938618]# kubectl get csv ibm-common-service-operator.v3.6.3 -o yaml|grep "operatorframework.io/properties"
    operatorframework.io/properties: '{"properties":[{"type":"olm.gvk","value":{"group":"operator.ibm.com","kind":"CommonService","version":"v3"}},{"type":"olm.package","value":{"packageName":"ibm-common-service-operator","version":"3.6.3"}}]}'
          f:operatorframework.io/properties: {}
[root@preserve-olm-env 1938618]# kubectl patch -n default csv ibm-common-service-operator.v3.6.3 --type=json -p='[{"op":"remove","path":"/metadata/annotations/operatorframework.io~1properties"}]'
clusterserviceversion.operators.coreos.com/ibm-common-service-operator.v3.6.3 patched
[root@preserve-olm-env 1938618]# kubectl get csv ibm-common-service-operator.v3.6.3 -o yaml|grep "operatorframework.io/properties"
[root@preserve-olm-env 1938618]# cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: test-ibm-integration-platform-navigator
  namespace: default
spec:
  channel: v4.1-eus
  installPlanApproval: Automatic
  name: ibm-integration-platform-navigator
  source: ibm-operator-catalog
  sourceNamespace: default
[root@preserve-olm-env 1938618]# kubectl create -f sub.yaml 
subscription.operators.coreos.com/test-ibm-integration-platform-navigator created
[root@preserve-olm-env 1938618]# kubectl get csv
NAME                                        DISPLAY                                            VERSION   REPLACES                                    PHASE
ibm-common-service-operator.v3.6.3          IBM Cloud Platform Common Services                 3.6.3     ibm-common-service-operator.v3.6.2          Succeeded
ibm-integration-platform-navigator.v4.1.1   IBM Cloud Pak for Integration Platform Navigator   4.1.1     ibm-integration-platform-navigator.v4.1.0   Succeeded
[root@preserve-olm-env 1938618]# 

--

Comment 5 errata-xmlrpc 2021-03-30 17:03:15 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 (OpenShift Container Platform 4.6.23 bug fix update), 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-2021:0952