Bug 1898746 - opm index add cannot batch add multiple bundles that use skips
Summary: opm index add cannot batch add multiple bundles that use skips
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.6.z
Assignee: Evan Cordell
QA Contact: kuiwang
URL:
Whiteboard:
Depends On: 1885425
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-18 01:11 UTC by Nick Hale
Modified: 2020-12-21 13:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1885425
Environment:
Last Closed: 2020-12-21 13:23:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-registry pull 521 0 None closed [release-4.6] Bug 1898746: fix(indexing): order bulk add by version field 2021-01-15 11:41:51 UTC
Red Hat Product Errata RHSA-2020:5614 0 None None None 2020-12-21 13:24:07 UTC

Comment 3 kuiwang 2020-12-14 05:04:54 UTC
verify it on 4.6. LGTM
--
[root@preserve-olm-env operator-registry]# git log -n 1
commit e86c799beecfbba0b2d679702248e3ef526ae0ee
Merge: d1f1485 f453ca4
Author: OpenShift Merge Robot <openshift-merge-robot.github.com>
Date:   Thu Dec 10 21:52:51 2020 -0500

    Merge pull request #521 from njhale/4.6-fix-bulk-add
    
    [release-4.6] Bug 1898746: fix(indexing): order bulk add by version field
[root@preserve-olm-env operator-registry]# make clan;make build
make: *** No rule to make target `clan'.  Stop.
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/appregistry-server ./cmd/appregistry-server
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/configmap-server ./cmd/configmap-server
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/initializer ./cmd/initializer
GOFLAGS="-mod=vendor" go build  -tags "json1" -o bin/registry-server ./cmd/registry-server
GOFLAGS="-mod=vendor" go build -ldflags "-X 'github.com/operator-framework/operator-registry/cmd/opm/version.gitCommit=e86c799' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.14.3-22-ge86c799' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-12-14T02:47:43Z'"  -tags "json1" -o bin/opm ./cmd/opm
[root@preserve-olm-env operator-registry]# 

[root@preserve-olm-env operator-registry]# grep "replaces" manifests/teiid-1885425/0.3.0/teiid.v0.3.0.clusterserviceversion.yaml
[root@preserve-olm-env operator-registry]# grep "replaces" manifests/teiid-1885425/0.4.0/teiid.v0.4.0.clusterserviceversion.yaml
[root@preserve-olm-env operator-registry]# grep -A1 "skips:" manifests/teiid-1885425/0.3.0/teiid.v0.3.0.clusterserviceversion.yaml
  skips:
  - teiid.v0.2.0
[root@preserve-olm-env operator-registry]# grep -A1 "skips:" manifests/teiid-1885425/0.4.0/teiid.v0.4.0.clusterserviceversion.yaml
  skips:
  - teiid.v0.3.0
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1885425/0.3.0 --tag quay.io/kuiwang/teiid-operator:v1898746-3 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1885425/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /root/kuiwang/operator-registry 
INFO[0000] Building bundle image                        
Sending build context to Docker daemon  116.7MB
Step 1/9 : FROM scratch
 ---> 
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Running in 7e91ab32458c
Removing intermediate container 7e91ab32458c
 ---> 6a0f255c8e40
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Running in 6c450ca2d647
Removing intermediate container 6c450ca2d647
 ---> 83bfa06ed751
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Running in 221f8e3e77e2
Removing intermediate container 221f8e3e77e2
 ---> 1c516002a971
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Running in 39711a9b4379
Removing intermediate container 39711a9b4379
 ---> 97c07920082e
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Running in f38089adb312
Removing intermediate container f38089adb312
 ---> 1851b8b6ee06
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Running in e2f46db24586
Removing intermediate container e2f46db24586
 ---> 9b46cdec78a4
Step 8/9 : COPY manifests/teiid-1885425/0.3.0 /manifests/
 ---> 48f2ee6cdf0c
Step 9/9 : COPY manifests/teiid-1885425/metadata /metadata/
 ---> 4dc094741b65
Successfully built 4dc094741b65
Successfully tagged quay.io/kuiwang/teiid-operator:v1898746-3
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v1898746-3
The push refers to repository [quay.io/kuiwang/teiid-operator]
3ea7a9fafd60: Pushed 
820e38922bab: Pushed 
v1898746-3: digest: sha256:c5dc8f1a89158027f8759beaeeef8e70e4489d46b8d5452fdac3293d6ccf899b size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile  manifests/teiid-1885425/metadata/
[root@preserve-olm-env operator-registry]# 



[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1885425/0.4.0 --tag quay.io/kuiwang/teiid-operator:v1898746-4 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1885425/metadata 
INFO[0000] Building Dockerfile                          
INFO[0000] Writing bundle.Dockerfile in /root/kuiwang/operator-registry 
INFO[0000] Building bundle image                        
Sending build context to Docker daemon  116.7MB
Step 1/9 : FROM scratch
 ---> 
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> 6a0f255c8e40
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 83bfa06ed751
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 1c516002a971
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Using cache
 ---> 97c07920082e
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Using cache
 ---> 1851b8b6ee06
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Using cache
 ---> 9b46cdec78a4
Step 8/9 : COPY manifests/teiid-1885425/0.4.0 /manifests/
 ---> 433d0d529338
Step 9/9 : COPY manifests/teiid-1885425/metadata /metadata/
 ---> 75f4eb8edda0
Successfully built 75f4eb8edda0
Successfully tagged quay.io/kuiwang/teiid-operator:v1898746-4
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v1898746-4
The push refers to repository [quay.io/kuiwang/teiid-operator]
88a0f32f57bc: Pushed 
7bd4434da71b: Pushed 
v1898746-4: digest: sha256:12ed428e0bde827cda879bdc7c30600e3b12d34be8ff5c5f6d8075b81721bc22 size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile  manifests/teiid-1885425/metadata/
[root@preserve-olm-env operator-registry]# 


[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v1898746-3,quay.io/kuiwang/teiid-operator:v1898746-4  --tag quay.io/kuiwang/teiid-index:1898746 -c docker
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v1898746-3  bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0000] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0000] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0000] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v1898746-4  bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0001] Could not find optional dependencies file     dir=bundle_tmp090389569 file=bundle_tmp090389569/metadata load=annotations
INFO[0001] found csv, loading bundle                     dir=bundle_tmp090389569 file=bundle_tmp090389569/manifests load=bundle
INFO[0001] loading bundle file                           dir=bundle_tmp090389569/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0001] loading bundle file                           dir=bundle_tmp090389569/manifests file=teiid.v0.3.0.clusterserviceversion.yaml load=bundle
INFO[0001] Could not find optional dependencies file     dir=bundle_tmp380898988 file=bundle_tmp380898988/metadata load=annotations
INFO[0001] found csv, loading bundle                     dir=bundle_tmp380898988 file=bundle_tmp380898988/manifests load=bundle
INFO[0001] loading bundle file                           dir=bundle_tmp380898988/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0001] loading bundle file                           dir=bundle_tmp380898988/manifests file=teiid.v0.4.0.clusterserviceversion.yaml load=bundle
INFO[0001] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0001] writing dockerfile: index.Dockerfile643462903  bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0001] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
INFO[0001] [docker build -f index.Dockerfile643462903 -t quay.io/kuiwang/teiid-index:1898746 .]  bundles="[quay.io/kuiwang/teiid-operator:v1898746-3 quay.io/kuiwang/teiid-operator:v1898746-4]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1898746
The push refers to repository [quay.io/kuiwang/teiid-index]
a8040a4bd098: Pushed 
bbfc9e481d2c: Mounted from operator-framework/upstream-opm-builder 
9519ea221559: Mounted from operator-framework/upstream-opm-builder 
13a27d679967: Mounted from operator-framework/upstream-opm-builder 
6160650cb81f: Mounted from operator-framework/upstream-opm-builder 
f4666769fca7: Mounted from operator-framework/upstream-opm-builder 
1898746: digest: sha256:271da99c289c648bb84561d3434e3ca846e15e220a075961550b3f3e34a9c048 size: 1578
[root@preserve-olm-env operator-registry]# 


[root@preserve-olm-env operator-registry]# docker create quay.io/kuiwang/teiid-index:1898746
70813b47777189a34511d8bba2393346a221ae3f13e82e239c38554e8fd35a6f
[root@preserve-olm-env operator-registry]# cd ../cases/1898746
[root@preserve-olm-env 1898746]# docker cp 70813b47777189a34511d8bba2393346a221ae3f13e82e239c38554e8fd35a6f:/database/index.db .
[root@preserve-olm-env 1898746]# docker rm 70813b47777189a34511d8bba2393346a221ae3f13e82e239c38554e8fd35a6f
70813b47777189a34511d8bba2393346a221ae3f13e82e239c38554e8fd35a6f
[root@preserve-olm-env 1898746]# sqlite3 index.db
SQLite version 3.7.17 2013-05-20 00:56:22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .header on
sqlite> .mode column
sqlite> .table
api                channel            operatorbundle     related_image    
api_provider       channel_entry      package            schema_migrations
api_requirer       dependencies       properties       
sqlite> SELECT name, version, replaces FROM operatorbundle;
name          version     replaces  
------------  ----------  ----------
teiid.v0.3.0  0.3.0                 
teiid.v0.4.0  0.4.0                 
sqlite> select * from operatorbundle;
name          csv         bundle      bundlepath                                 skiprange   version     replaces    skips       
------------  ----------  ----------  -----------------------------------------  ----------  ----------  ----------  ------------
teiid.v0.3.0                          quay.io/kuiwang/teiid-operator:v1898746-3              0.3.0                   teiid.v0.2.0
teiid.v0.4.0  {"apiVersi  {"apiVersi  quay.io/kuiwang/teiid-operator:v1898746-4              0.4.0                   teiid.v0.3.0
sqlite> select entry_id, replaces, operatorbundle_name from channel_entry;
entry_id    replaces    operatorbundle_name
----------  ----------  -------------------
1                       teiid.v0.4.0       
2                       teiid.v0.3.0       
3           2           teiid.v0.4.0       
sqlite> select * from channel;
name        package_name  head_operatorbundle_name
----------  ------------  ------------------------
beta        teiid         teiid.v0.4.0            
sqlite> .exit

[root@preserve-olm-env 1898746]# oc exec catalog-operator-9d57b8666-qhr84 -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.16.1
git commit: b9d0c21550063dc4a94d461339796c644cba6ed6
[root@preserve-olm-env 1898746]# cat teiidcatsrc.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: teiid
  namespace: default
spec:
  displayName: "teiid Operators"
  image: quay.io/kuiwang/teiid-index:1898746
  publisher: QE
  sourceType: grpc
[root@preserve-olm-env 1898746]# oc apply -f teiidcatsrc.yaml 
catalogsource.operators.coreos.com/teiid created
[root@preserve-olm-env 1898746]# cat og-single.yaml 
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1898746]# oc apply -f og-single.yaml 
operatorgroup.operators.coreos.com/og-single1 created
[root@preserve-olm-env 1898746]# cat teiidsub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: teiid
  namespace: default
spec:
  source: teiid
  sourceNamespace: default

  channel: beta
  installPlanApproval: Automatic
  name: teiid
[root@preserve-olm-env 1898746]# oc apply -f teiidsub.yaml
subscription.operators.coreos.com/teiid created
[root@preserve-olm-env 1898746]# oc get ip
NAME            CSV            APPROVAL    APPROVED
install-nct9v   teiid.v0.4.0   Automatic   true

[root@preserve-olm-env 1898746]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.4.0   Teiid     0.4.0                Succeeded
[root@preserve-olm-env 1898746]# 

--

Comment 6 errata-xmlrpc 2020-12-21 13:23:55 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.6.9 security and bug fix 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:5614


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