Bug 1790785 - `oc adm catalog build` should immediately error out if it can't find any data in appregistry
Summary: `oc adm catalog build` should immediately error out if it can't find any data...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.5.0
Assignee: Bowen Song
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks: 1804554
TreeView+ depends on / blocked
 
Reported: 2020-01-14 07:44 UTC by Jian Zhang
Modified: 2020-05-04 11:24 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1796675 (view as bug list)
Environment:
Last Closed: 2020-05-04 11:24:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc pull 288 0 None closed Bug 1790785: `oc adm catalog build` should immediately error out if it can't find any data in appregistry 2020-08-20 13:35:30 UTC
Github openshift oc pull 316 0 None closed Bug 1790785: bump(operator-framework/operator-registry) 2020-08-20 13:35:30 UTC
Github openshift oc pull 329 0 None closed Bug 1790785: bump(operator-framework/operator-registry) 2020-08-20 13:35:30 UTC
Github operator-framework operator-registry pull 148 0 None closed Bug 1790785: feat(appr): exit build early if no manifests were downloaded 2020-08-20 13:35:30 UTC
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-04 11:24:32 UTC

Description Jian Zhang 2020-01-14 07:44:05 UTC
Description of problem:
No error report when the `oc adm catalog build` gets none data.


Version-Release number of selected component (if applicable):
Cluster version is: 4.3.0-0.nightly-2020-01-14-000626 
[jzhang@dhcp-140-36 ~]$ oc version
Client Version: 4.3.0-0.nightly-2020-01-14-000626
Server Version: 4.3.0-0.nightly-2020-01-14-000626
Kubernetes Version: v1.16.2

How reproducible:
always

Steps to Reproduce:
1. Create an OCP 4.3.

2. Enable the cluster registry.
[jzhang@dhcp-140-36 ~]$ oc patch configs.imageregistry.operator.openshift.io/cluster -p='{"spec":{"defaultRoute":true}}' --type=merge
config.imageregistry.operator.openshift.io/cluster patched
[jzhang@dhcp-140-36 ~]$ oc get images.config.openshift.io/cluster  -o jsonpath={.status.externalRegistryHostnames[0]} 
default-route-openshift-image-registry.apps.qe-jiazha-dis.qe.devcluster.openshift.com
[jzhang@dhcp-140-36 ~]$ oc get secret router-certs-default -n openshift-ingress -o json |jq -r '.data["tls.crt"]' | base64 -d | sudo tee /etc/pki/ca-trust/source/anchors/disconnected.crt
[jzhang@dhcp-140-36 ~]$ sudo update-ca-trust 
[jzhang@dhcp-140-36 ~]$ oc create serviceaccount registry
serviceaccount/registry created
[jzhang@dhcp-140-36 ~]$ oc adm policy add-cluster-role-to-user admin -z registry
clusterrole.rbac.authorization.k8s.io/admin added: "registry"
[jzhang@dhcp-140-36 ~]$ docker login default-route-openshift-image-registry.apps.qe-jiazha-dis.qe.devcluster.openshift.com -u reegistry -p `oc sa get-token registry`

3. Run "oc adm catalog build xxx", like below:
[jzhang@dhcp-140-36 ~]$ oc adm catalog build --appregistry-org=redhat-operators-art --to=default-route-openshift-image-registry.apps.qe-jiazha-dis.qe.devcluster.openshift.com/openshift/olm:v1 

Actual results:
The "oc adm catalog build" runs successfully, no errors out.
[jzhang@dhcp-140-36 ~]$ oc adm catalog build --appregistry-org=redhat-operators-art --auth-token="xxx"(replace real token with xxx) --to=default-route-openshift-image-registry.apps.qe-jiazha-dis.qe.devcluster.openshift.com/openshift/olm:v1 
INFO[0001] loading Bundles                               dir=/tmp/manifests-445659376
INFO[0001] directory                                     dir=/tmp/manifests-445659376 file=manifests-445659376 load=bundles
INFO[0001] loading Packages and Entries                  dir=/tmp/manifests-445659376
INFO[0001] directory                                     dir=/tmp/manifests-445659376 file=manifests-445659376 load=package
Uploading ... 471.6B/s
Uploading 3.405MB ...
Uploading 9.833MB ...
Pushed sha256:18958ad670fc84e93e4149b933eaa6173adb22a4e2dfc70f0db84b36ee0d1bb2 to default-route-openshift-image-registry.apps.qe-jiazha-dis.qe.devcluster.openshift.com/openshift/olm:v1


Expected results:
Since this redhat-operators-art is a private repo, the "oc adm catalog build" cannot get any data, but it should report errors immediately.

Additional info:

Comment 9 Jian Zhang 2020-03-10 02:30:30 UTC
oc version:
[jzhang@dhcp-140-36 ~]$ ./oc version -o yaml
clientVersion:
  buildDate: "2020-03-07T03:47:49Z"
  compiler: gc
  gitCommit: 8ce61268781d2074158d05ad11141792b94b1910
  gitTreeState: dirty
  gitVersion: openshift-clients-4.5.0-202003062301
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64
releaseClientVersion: 4.5.0-0.nightly-2020-03-09-225220
...

1, Build a local docker registry.
2, Run "oc adm catalog build xxx", like below:
[jzhang@dhcp-140-36 ~]$ ./oc adm catalog build --appregistry-org=redhat-operators-art --to=localhost:5000/olm/bug:v1
error: no manifests downloaded from appregistry https://quay.io/cnr/redhat-operators-art

The errors report timely, LGTM, verify it.

Comment 11 errata-xmlrpc 2020-05-04 11:24:06 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, 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:0581


Note You need to log in before you can comment on or make changes to this bug.