Bug 2090135

Summary: [upstream] Operator-sdk run bundle offer the wrong error message
Product: OpenShift Container Platform Reporter: Fan Jia <jfan>
Component: Operator SDKAssignee: Rashmi Gottipati <rgottipa>
Status: CLOSED ERRATA QA Contact: Fan Jia <jfan>
Severity: high Docs Contact:
Priority: high    
Version: 4.11CC: cchantse, dageoffr, rgottipa
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: 2023-01-17 19:49:26 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-05-25 08:36:12 UTC
Description of problem:
Operator-sdk run bundle will give the wrong error message while the offered index image doesn't exist or UNAUTHORIZED.

Version-Release number of selected component (if applicable):
operator-sdk version
operator-sdk version: "v1.20.0-16-g38b8b8d9", commit: "38b8b8d949578a44fb23319e56c242fd620523ca", kubernetes version: "v1.23", go version: "go1.17.4", GOOS: "linux", GOARCH: "amd64"

How reproducible:
always

Steps to Reproduce:
1.install operator through run bundle (the index image doesn't exist)
$ operator-sdk run bundle quay.io/xxxxx/k8sstatus-bundle:v4.10 --index-image quay.io/kakatest/kkkkk:test

Actual results:
$operator-sdk-upstream run bundle quay.io/xxxxx/k8sstatus-bundle:v4.10 --index-image quay.io/kakatest/kkkkk:test
FATA[0010] Failed to run bundle: error in upgrading the bundle "" that was installed traditionally 

Expected results:
$operator-sdk-upstream run bundle quay.io/xxxxx/k8sstatus-bundle:v4.10 --index-image quay.io/kakatest/kkkkk:test
FATA[0011] Failed to run bundle: create catalog: error creating registry pod: get database path: get index image labels: error pulling image quay.io/kakatest/kkkkk:test: error resolving name : unexpected status code [manifests test]: 401 UNAUTHORIZED 


Additional info:

Comment 1 Rashmi Gottipati 2022-05-26 19:07:35 UTC
I've tried to reproduce this issue by running the below: 
$operator-sdk run bundle quay.io/xxxxx/k8sstatus-bundle:v4.10 --index-image quay.io/kakatest/kkkkk:test (the bundle image and index image that you provided).

Here is the error message I got:
FATA[0001] Failed to run bundle: pull bundle image: error pulling image quay.io/xxxxx/k8sstatus-bundle:v4.10: error resolving name : unexpected status code [manifests v4.10]: 401 UNAUTHORIZED

This is the actual and expected result when we try to install an operator bundle with an index that does not exist/or is unauthorized. 

However, in your description, I do notice that the actual result is different to what I'm seeing when I run it. 

Are you trying to run this locally or a specific OCP version? 
Also, I'm not sure why this a blocker, since it may be related to improved error logging for run bundle feature. Could you please clarify? 

Looking forward to your clarifications.

Thanks!

Comment 3 Rashmi Gottipati 2022-06-22 17:53:40 UTC
Created PR https://github.com/operator-framework/operator-sdk/pull/5893 to fix this bug. Please do verify the fix. Thanks Jia!

Comment 8 errata-xmlrpc 2023-01-17 19:49:26 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 (Moderate: OpenShift Container Platform 4.12.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:7399