Bug 1994110

Summary: Minor OpenShift upgrades blocked when olm.maxOpenShiftVersion = current Y-stream+1 and current Z-stream > 0
Product: OpenShift Container Platform Reporter: OpenShift BugZilla Robot <openshift-bugzilla-robot>
Component: OLMAssignee: Nick Hale <nhale>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: tflannag
Version: 4.8   
Target Milestone: ---   
Target Release: 4.8.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: Cluster Z-stream version used in operator compatibility comparison. Consequence: When the current Z-stream release of a cluster is > 0, operators with an olm.maxOpenShiftVersion property = current-Y + 1 cause OpenShift minor version upgrades to be blocked. Fix: Ignore cluster Z-stream version when calculating operator compatibility. Result: Cluster upgrades do not get blocked by Z-stream incompatibilities.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-31 16:17:11 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: 1993286    
Bug Blocks:    

Comment 2 Jian Zhang 2021-08-20 03:12:40 UTC
I can reproduce this issue on OCP 4.8.6, as follow,

[cloud-user@preserve-olm-env jian]$ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.8.6     True        False         26m     Cluster version is 4.8.6

[cloud-user@preserve-olm-env jian]$ oc get csv -o yaml|grep "maxOpenShiftVersion"
      olm.properties: '[{"type": "olm.maxOpenShiftVersion", "value": "4.9"}]'

[cloud-user@preserve-olm-env jian]$ oc get co operator-lifecycle-manager -o=jsonpath={.status.conditions[?(@.type==\"Upgradeable\")].status}
False

Since the fixed PR only merged in the Nightly payload: 4.8.0-0.nightly-2021-08-19-202721, and we cannot test this scenario in the Nightly payload. I will test this bug once the 4.8.7 is generated.

Comment 4 Jian Zhang 2021-08-25 06:53:31 UTC
1, Create the 4.8.7 cluster that contains the fixed PR.
[cloud-user@preserve-olm-env jian]$ oc adm release info quay.io/openshift-release-dev/ocp-release:4.8.7-x86_64 --commits|grep lifecycle
  operator-lifecycle-manager                     https://github.com/openshift/operator-framework-olm                         8ff5f22d9336dd8df45d7a839bf756a492bb4332

[cloud-user@preserve-olm-env jian]$ oc get clusterversion
NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.8.7     True        False         6m5s    Cluster version is 4.8.7

2, Install an operator that its "maxOpenShiftVersion=4.9".

[cloud-user@preserve-olm-env jian]$ cat cs-max.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: max-operators
  namespace: openshift-marketplace
spec:
  displayName: Jian Operators
  image: quay.io/olmqe/etcd-index:upgrade-max3
  priority: -200
  publisher: Jian
  sourceType: grpc
  updateStrategy:
    registryPoll:
      interval: 10m0s
[cloud-user@preserve-olm-env jian]$ oc create -f cs-max.yaml 
catalogsource.operators.coreos.com/max-operators created

[cloud-user@preserve-olm-env jian]$ oc get packagemanifest|grep etcd
etcd                                                 Jian Operators        54s
etcd                                                 Community Operators   50m


[cloud-user@preserve-olm-env jian]$ cat og.yaml 
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: default-og
  namespace: default
spec:
  targetNamespaces:
  - default
[cloud-user@preserve-olm-env jian]$ oc create -f og.yaml 
operatorgroup.operators.coreos.com/default-og created

[cloud-user@preserve-olm-env jian]$ cat sub-etcd.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: etcd
  namespace: default
spec:
  channel: singlenamespace-alpha
  installPlanApproval: Automatic
  name: etcd
  source: max-operators
  sourceNamespace: openshift-marketplace
  startingCSV: etcdoperator.v0.9.4
[cloud-user@preserve-olm-env jian]$ oc create -f sub-etcd.yaml 
subscription.operators.coreos.com/etcd created

[cloud-user@preserve-olm-env jian]$ oc get sub -n default
NAME   PACKAGE   SOURCE          CHANNEL
etcd   etcd      max-operators   singlenamespace-alpha
[cloud-user@preserve-olm-env jian]$ oc get ip -n default
NAME            CSV                   APPROVAL    APPROVED
install-bmdk5   etcdoperator.v0.9.4   Automatic   true
[cloud-user@preserve-olm-env jian]$ oc get csv -n default
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded

[cloud-user@preserve-olm-env jian]$ oc get csv -n default -o yaml |grep "maxOpenShiftVersion"
      olm.properties: '[{"type": "olm.maxOpenShiftVersion", "value": "4.9"}]'

3, Check the OLM's Upgradeable value, it should be True.
[cloud-user@preserve-olm-env jian]$ oc get co operator-lifecycle-manager -o=jsonpath={.status.conditions[?(@.type==\"Upgradeable\")].status}
True

LGTM, verify it.

Comment 6 errata-xmlrpc 2021-08-31 16:17:11 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.8.9 bug fix), 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:3247