Bug 1827821
Summary: | Operator update is failing due to missing replace field in Operator CSV | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Alexander Greene <agreene> |
Component: | OLM | Assignee: | Alexander Greene <agreene> |
OLM sub component: | OLM | QA Contact: | Jian Zhang <jiazha> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | high | ||
Priority: | high | CC: | afield, ecordell, jiazha, nhale |
Version: | 4.4 | ||
Target Milestone: | --- | ||
Target Release: | 4.4.z | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: |
Cause: If an operator is being upgraded that provides a required API whose GVK has not changed since the previous version of the operator and the operator that depends on the API uses a skipRange instead of the Spec.Replaces field, OLM fails to generate the "upgraded CSV" with the correct replaces field. Specifically, OLM would:
1. Add the new operator to the generation, and marking the APIs it provides as "present".
2. Remove the old operator from the generation, marking the APIs it provides as "absent", despite being provided by the new version of the operator.
3. Attempt to resolve the "missing" apis, overwriting the the new version of the operator with a copy that does not have its Spec.Replaces field set.
Consequence: Certain operators would fail to upgrade to new versions.
Fix: OLM was updated to remove the old operator from the current generation before adding the new operator to the generation.
Result: The upgrade will succeed as expected.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2020-05-18 13:35:02 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: | 1818788 | ||
Bug Blocks: | 1827822 |
Description
Alexander Greene
2020-04-24 21:19:51 UTC
*** Bug 1828007 has been marked as a duplicate of this bug. *** Cluster version is 4.4.0-0.nightly-2020-05-08-202645 mac:~ jianzhang$ oc -n openshift-operator-lifecycle-manager exec catalog-operator-6dfff7dbcc-9qhp8 -- olm --version OLM version: 0.14.2 git commit: f8ef76c241abfeeb45fa680599b9c683ec3173cf 1, installed a catsrc that pointed to the catalog image that only contained the 1.0.0 versions of the operator mac:~ jianzhang$ oc create -f cs-1818788.yaml catalogsource.operators.coreos.com/agreene-operators created mac:~ jianzhang$ cat cs-1818788.yaml apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: agreene-operators namespace: openshift-marketplace spec: displayName: Agreene Operators image: quay.io/agreene/busybox-dependencies:old sourceType: grpc mac:~ jianzhang$ oc project openshift-marketplace Now using project "openshift-marketplace" on server "https://api.ci-ln-49c5tdb-d5d6b.origin-ci-int-aws.dev.rhcloud.com:6443". mac:~ jianzhang$ oc get catalogsource NAME DISPLAY TYPE PUBLISHER AGE agreene-operators Agreene Operators grpc 25s certified-operators Certified Operators grpc Red Hat 18m community-operators Community Operators grpc Red Hat 18m redhat-marketplace Red Hat Marketplace grpc Red Hat 18m redhat-operators Red Hat Operators grpc Red Hat 18m mac:~ jianzhang$ oc get pods NAME READY STATUS RESTARTS AGE agreene-operators-698zv 1/1 Running 0 30s certified-operators-6f864f4557-b2k4l 1/1 Running 0 18m community-operators-585dcd69dc-c2gcp 1/1 Running 0 18m marketplace-operator-fc5546ffb-9gbrf 1/1 Running 0 18m redhat-marketplace-7b995fdb4d-r6lf6 1/1 Running 0 18m redhat-operators-8496cc7d5b-cklzb 1/1 Running 0 18m mac:~ jianzhang$ oc get packagemanifest|grep busy busybox-dependency Agreene Operators 61s busybox Agreene Operators 61s 2, created an OperatorGroup and a subscription mac:~ jianzhang$ oc create -f og.yaml operatorgroup.operators.coreos.com/test-og created mac:~ jianzhang$ oc get og NAME AGE test-og 4s mac:~ jianzhang$ cat og.yaml apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: test-og namespace: openshift-marketplace spec: targetNamespaces: - openshift-marketplace mac:~ jianzhang$ oc create -f sub-1818788.yaml subscription.operators.coreos.com/busybox created mac:~ jianzhang$ cat sub-1818788.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: busybox namespace: openshift-marketplace spec: channel: "alpha" installPlanApproval: Automatic name: busybox source: agreene-operators sourceNamespace: openshift-marketplace startingCSV: busybox.v1.0.0 mac:~ jianzhang$ oc get sub NAME PACKAGE SOURCE CHANNEL busybox busybox agreene-operators alpha busybox-dependency-alpha-agreene-operators-openshift-marketplace busybox-dependency agreene-operators alpha mac:~ jianzhang$ oc get csv NAME DISPLAY VERSION REPLACES PHASE busybox-dependency.v1.0.0 busybox-dependency 1.0.0 Succeeded busybox.v1.0.0 busybox 1.0.0 Succeeded 3, Update this CatalogSource image(quay.io/agreene/busybox-dependencies:old) to the new one: quay.io/agreene/busybox-dependencies:new(contains 2.0.0 version) mac:~ jianzhang$ oc edit catalogsource agreene-operators catalogsource.operators.coreos.com/agreene-operators edited mac:~ jianzhang$ oc get csv NAME DISPLAY VERSION REPLACES PHASE busybox-dependency.v2.0.0 busybox-dependency 2.0.0 busybox-dependency.v1.0.0 Succeeded busybox.v2.0.0 busybox 2.0.0 busybox.v1.0.0 Succeeded mac:~ jianzhang$ oc get pods NAME READY STATUS RESTARTS AGE agreene-operators-ngpbh 1/1 Running 0 2m4s busybox-8598cc9bcb-x9pv5 1/1 Running 0 105s busybox-dependency-76f7c74648-t5rbc 1/1 Running 0 101s ... The operator has been upgraded to "2.0.0" version successfully. LGTM, verify it. 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:2133 |