Description of problem: Failed to update from a head of the channel. Version-Release number of selected component (if applicable): Cluster version is 4.2.0-0.nightly-2019-09-11-032939 mac:~ jianzhang$ oc exec catalog-operator-68f64f5465-lz4rq -- olm --version OLM version: 0.11.0 git commit: 95572bce2416891c270c90a4437dc4a121a43e72 How reproducible: always Steps to Reproduce: 1, Create the manifest, see: https://github.com/jianzhangbjz/operator-registry/tree/olm-1055/manifests/etcd Define the "olm.skipRange: > 0.6.0 < 0.9.9", but no "replace", in the v0.9.0 operator csv. Define the "replaces: etcdoperator.v0.9.0", but no "olm.skipRange" in the v0.9.2 operator csv. Define the "olm.skipRange: !0.9.2" and "replaces: etcdoperator.v0.9.2" in the v0.9.4 operator csv. 2, Build them into an image and push it to Quay.io: quay.io/jiazha/etcd-operator:v0.6.1-skip mac:operator-registry jianzhang$ docker build -f upstream-example.Dockerfile -t quay.io/jiazha/etcd-operator:v0.6.1-skip . 3. Create a CatatlogSource, which consume the above image. Like below: mac:~ jianzhang$ cat cs-42.yaml apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: test-operator namespace: default spec: sourceType: grpc image: quay.io/jiazha/etcd-operator:v0.6.1-skip displayName: Test Operators publisher: Test mac:~ jianzhang$ oc create -f cs-42.yaml catalogsource.operators.coreos.com/test-operator created mac:~ jianzhang$ oc get catalogsource NAME DISPLAY TYPE PUBLISHER AGE test-operator Test Operators grpc Test 66s 4. Create an OperatorGroup in project default. mac:~ jianzhang$ oc get og -n default NAME AGE test-og 147m mac:~ jianzhang$ cat og.yaml apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: test-og namespace: default spec: targetNamespaces: - default 5. Subscribe the etcd-operator, which a low version. For example, v0.6.1 mac:~ jianzhang$ cat sub-42.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: generateName: etcd-skip- namespace: default spec: source: test-operator sourceNamespace: default name: etcd startingCSV: etcdoperator.v0.6.1 channel: singlenamespace-alpha Actual results: The version of the etcd-operator is 0.6.1, it should be updated to v0.9.4. mac:~ jianzhang$ oc get sub -n default NAME PACKAGE SOURCE CHANNEL etcd-skip-xv6bh etcd test-operator singlenamespace-alpha mac:~ jianzhang$ oc get csv -n default NAME DISPLAY VERSION REPLACES PHASE etcdoperator.v0.6.1 etcd 0.6.1 Succeeded Expected results: The etcd-operator should be upgraded to v0.9.4 automatically. Additional info: The related logs: time="2019-09-12T05:39:05Z" level=info msg="error updating subscription status" channel=singlenamespace-alpha error="Operation cannot be fulfilled on subscriptions.operators.coreos.com \"etcd-skip-xv6bh\": the object has been modified; please apply your changes to the latest version and try again" id=yzw/n namespace=default pkg=etcd source=test-operator sub=etcd-skip-xv6bh E0912 05:39:05.722794 1 queueinformer_operator.go:282] sync "default" failed: error updating Subscription status: Operation cannot be fulfilled on subscriptions.operators.coreos.com "etcd-skip-xv6bh": the object has been modified; please apply your changes to the latest version and try again time="2019-09-12T05:39:06Z" level=info msg=syncing event=update reconciling="*v1alpha1.Subscription" selflink=/apis/operators.coreos.com/v1alpha1/namespaces/default/subscriptions/etcd-skip-xv6bh
In your package yaml here: https://github.com/jianzhangbjz/operator-registry/blob/olm-1055/manifests/etcd/etcd.package.yaml#L3-L4 You have the "head" of the singlenamespace-alpha channel set to 0.6.1: currentCSV: etcdoperator.v0.6.1 Since there are no newer operators in that channel, the installed operator remains at 0.6.1.
Moving this to 4.3. Will continue to try and reproduce but even if this is valid, we dont feel its a release blocker. Will evaluate early in the 4.3 cycle and consider if a 4.2.z backport if valid.
Hi, Vu Thanks for your explanation! I see now. I set the `skipRange` on the currentCSV etcdoperator.v0.9.4 in https://github.com/jianzhangbjz/operator-registry/blob/ocp42-olm-1055/manifests/etcd/etcdoperator.v0.9.4.clusterserviceversion.yaml#L8-L9 1, Create an image called "quay.io/jiazha/etcd-operator:skip-42" to consume these manifest. 2, Create a CatalogSource to consume this image. mac:~ jianzhang$ cat cs-42.yaml apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: test-operator namespace: openshift-marketplace spec: sourceType: grpc image: quay.io/jiazha/etcd-operator:skip-42 displayName: Jian Operators publisher: jian 3, Create a subscription to etcdoperator.v0.9.0. mac:~ jianzhang$ cat sub-42-skip.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: generateName: etcd-skip- namespace: jian spec: source: test-operator sourceNamespace: openshift-marketplace name: etcd installPlanApproval: Manual startingCSV: etcdoperator.v0.9.0 channel: singlenamespace-alpha 4, Approval it. Now, we can see the next version is etcdoperator.v0.9.4, not etcdoperator.v0.9.2, LGTM. mac:~ jianzhang$ oc get sub NAME PACKAGE SOURCE CHANNEL etcd-skip-wbsxc etcd test-operator singlenamespace-alpha mac:~ jianzhang$ oc get ip NAME CSV APPROVAL APPROVED install-6sp7d etcdoperator.v0.9.4 Manual false install-mgb7w etcdoperator.v0.9.0 Manual true mac:~ jianzhang$ oc get csv NAME DISPLAY VERSION REPLACES PHASE etcdoperator.v0.9.0 etcd 0.9.0 Succeeded 5, The etcdoperator.v0.9.2 has been skipped. LGTM, verify it. mac:~ jianzhang$ oc get ip NAME CSV APPROVAL APPROVED install-6sp7d etcdoperator.v0.9.4 Manual true install-mgb7w etcdoperator.v0.9.0 Manual true mac:~ jianzhang$ oc get csv NAME DISPLAY VERSION REPLACES PHASE etcdoperator.v0.9.4 etcd 0.9.4 etcdoperator.v0.9.0 Succeeded Cluster version is 4.3.0-0.nightly-2019-11-10-185106
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-2020:0062