Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 2100007

Summary: Run bundle-upgrade failed from the traditional File-Based Catalog installed operator
Product: OpenShift Container Platform Reporter: Fan Jia <jfan>
Component: Operator SDKAssignee: Rashmi Gottipati <rgottipa>
Status: CLOSED ERRATA QA Contact: Fan Jia <jfan>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.11CC: cchantse, jesusr
Target Milestone: ---   
Target Release: 4.12.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:19:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fan Jia 2022-06-22 08:07:15 UTC
Description of problem:
Run bundle-upgrade failed if the operator is installed with a FBC index image through traditional OLM way.

Version-Release number of selected component (if applicable):
operator-sdk version: "v1.20.0-ocp", commit: "4db4731ae75f2cccae951dd7ed98484662179c55", kubernetes version: "v1.24.1", go version: "go1.18.3", GOOS: "linux", GOARCH: "amd64"

How reproducible:
always

Steps to Reproduce:
1. install operator through catalogsource
$oc create -f catalogsource.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: upgradefbc-index
  namespace: testkaka
spec:
  displayName: Test
  publisher: OLM-QE
  sourceType: grpc
  image: quay.io/olmqe/upgradefbc-index:v0.1
  updateStrategy:
    registryPoll:
      interval: 15m
$oc create -f og.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single
  namespace: testkaka
spec:
  targetNamespaces:
  - testkaka

$oc create -f sub.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: test
  namespace: testkaka
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: upgradefbc
  source: upgradefbc-index
  sourceNamespace: testkaka
2. oc get pods
$ oc get pods
NAME                                                              READY   STATUS      RESTARTS   AGE
75d0b3dc04b4ab777d62672dbf403f153e93db06c90786c9a8779dbc4blrt4t   0/1     Completed   0          12m
upgradefbc-controller-manager-85d9df559f-ln7x7                    2/2     Running     0          12m
upgradefbc-index-xwl9c                                            1/1     Running     0          12m
3. upgrade operator through run bundle-upgrade
$operator-sdk run bundle-upgrade quay.io/olmqe/upgradefbc-bundle:v0.0.2

Actual results:
$ oc logs quay-io-olmqe-upgradefbc-bundle-v0-0-2
Error: could not build index model from declarative config: duplicate package "upgradefbc"
Usage:
  opm serve <source_path> [flags]

Flags:
      --debug                    enable debug logging
  -h, --help                     help for serve
  -p, --port string              port number to serve on (default "50051")
  -t, --termination-log string   path to a container termination log file (default "/dev/termination-log")

Global Flags:
      --skip-tls-verify   skip TLS certificate verification for container image registries while pulling bundles
      --use-http          use plain HTTP for container image registries while pulling bundles

Expected results:
upgrade success

Comment 1 Rashmi Gottipati 2022-06-23 21:39:06 UTC
Hi Jia, 

Just an update: PR https://github.com/operator-framework/operator-sdk/pull/5894 was created that fixes this issue. This fix will go into downstream during the next sync. 
Meanwhile, please do verify that the fix works and confirm the same. Thanks!

Thanks,
Rashmi

Comment 6 Fan Jia 2022-07-08 01:42:21 UTC
verified, will test after the pr merged to downstream.

Comment 7 errata-xmlrpc 2022-08-10 11:19: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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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/RHSA-2022:5069