Bug 1895268

Summary: The bundleAPIs should NOT be empty
Product: OpenShift Container Platform Reporter: Jian Zhang <jiazha>
Component: NetworkingAssignee: zenghui.shi <zshi>
Networking sub component: SR-IOV QA Contact: zhaozhanqi <zzhao>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: pliu, zzhao
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:31: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 Jian Zhang 2020-11-06 07:11:03 UTC
Description of problem:
Get the below errors when building the index image.
[root@preserve-olm-env data]# opm index add --bundles quay.io/openshift-qe-optional-operators/ose-sriov-network-operator-bundle@sha256:a10d59941be98c8a3c29963891508519dcdab9e58ed1a50d9fea35ad35789f51 --from-index quay.io/openshift-qe-optional-operators/ocp4-index:05 --tag quay.io/openshift-qe-optional-operators/ocp4-index:05 -c docker
INFO[0000] building the index                            bundles="[quay.io/openshift-qe-optional-operators/ose-sriov-network-operator-bundle@sha256:a10d59941be98c8a3c29963891508519dcdab9e58ed1a50d9fea35ad35789f51]"
...
ERRO[0002] permissive mode disabled                      bundles="[quay.io/openshift-qe-optional-operators/ose-sriov-network-operator-bundle@sha256:a10d59941be98c8a3c29963891508519dcdab9e58ed1a50d9fea35ad35789f51]" error="error checking provided apis in bundle sriov-network-operator.4.7.0-202011040327.p0: couldn't find sriovnetwork.openshift.io/v1/SriovNetworkNodePolicy (sriovnetworknodepolicies) in bundle. found: map[]"
Error: error checking provided apis in bundle sriov-network-operator.4.7.0-202011040327.p0: couldn't find sriovnetwork.openshift.io/v1/SriovNetworkNodePolicy (sriovnetworknodepolicies) in bundle. found: map[]


Version-Release number of selected component (if applicable):

[root@preserve-olm-env operator-registry]# opm version
Version: version.Version{OpmVersion:"v1.14.3-49-gbfe56a7", GitCommit:"bfe56a7", BuildDate:"2020-11-05T01:16:40Z", GoOs:"linux", GoArch:"amd64"}

sriov-network-operator.4.7.0-202011040327.p0


How reproducible:
always

Steps to Reproduce:
1. Run the index image build command:
$ opm index add --bundles quay.io/openshift-qe-optional-operators/ose-sriov-network-operator-bundle@sha256:a10d59941be98c8a3c29963891508519dcdab9e58ed1a50d9fea35ad35789f51 --from-index quay.io/openshift-qe-optional-operators/ocp4-index:05 --tag quay.io/openshift-qe-optional-operators/ocp4-index:05 -c docker

Actual results:
get the errors: error="error checking provided apis in bundle sriov-network-operator.4.7.0-202011040327.p0: couldn't find sriovnetwork.openshift.io/v1/SriovNetworkNodePolicy (sriovnetworknodepolicies) in bundle. found: map[]"


Expected results:
The index image can be built successfully.

Additional info:
I guess the root cause is here:
1, get the operator manifest to local
[root@preserve-olm-env release]# docker create quay.io/openshift-qe-optional-operators/ose-sriov-network-operator-bundle@sha256:a10d59941be98c8a3c29963891508519dcdab9e58ed1a50d9fea35ad35789f51 /bin/bash
92ae341363587f5035b779b88d1e1ae348591fe47914bbc48b5b3c1bad59f638
 
[root@preserve-olm-env release]# docker cp 92ae341363587f5035b779b88d1e1ae348591fe47914bbc48b5b3c1bad59f638:/manifests sriov
[root@preserve-olm-env release]# ls sriov/
sriov-network-operator-sriovibnetworks_crd.yaml         sriov-network-operator-sriovnetworknodestate.crd.yaml
sriov-network-operator-sriovnetwork.crd.yaml            sriov-network-operator-sriovoperatorconfig.crd.yaml
sriov-network-operator-sriovnetworknodepolicy.crd.yaml  sriov-network-operator.v4.7.0.clusterserviceversion.yaml
 
2, Check the CSV owned CRD field, find the group of SriovNetworkNodePolicy is "sriovnetworknodepolicies.sriovnetwork.openshift.io".
[root@preserve-olm-env release]# vim sriov/sriov-network-operator.v4.7.0.clusterserviceversion.yaml
...
    - description: Represents an policy of configuring SR-IOV components on nodes
      displayName: Sriov Network Node Policy
      kind: SriovNetworkNodePolicy
      name: sriovnetworknodepolicies.sriovnetwork.openshift.io
      version: v1
 
3, Check the CRD file, find the group of the SriovNetworkNodePolicy is "sriovnetwork.openshift.io".
[root@preserve-olm-env release]# vim ./sriov/sriov-network-operator-sriovnetworknodepolicy.crd.yaml
...
spec:
  group: sriovnetwork.openshift.io
  names:
    kind: SriovNetworkNodePolicy
    listKind: SriovNetworkNodePolicyList
    plural: sriovnetworknodepolicies

Comment 1 Jian Zhang 2020-11-06 08:07:26 UTC
Please ignore my analysis above, the group is correct. But, the provide `bundleAPIs` map is [], it's wried. Maybe some CRDs definitions are not incorrect. Transfer it to OLM component first.

Comment 3 zhaozhanqi 2020-11-10 06:32:46 UTC
Verified this bug on v4.7.0.202011100433.p0

Comment 6 errata-xmlrpc 2021-02-24 15:31: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.7.0 security, bug fix, and enhancement 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-2020:5633