Bug 1889721 - opm index add semver-skippatch mode does not respect prerelease versions
Summary: opm index add semver-skippatch mode does not respect prerelease versions
Keywords:
Status: VERIFIED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.7.0
Assignee: Ankita Thomas
QA Contact: kuiwang
URL:
Whiteboard:
Depends On:
Blocks: 1891064
TreeView+ depends on / blocked
 
Reported: 2020-10-20 13:02 UTC by Kevin Rizza
Modified: 2020-11-18 07:05 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github operator-framework operator-registry pull 486 None closed Bug 1889721: Check prerelease version for semver-skippatch mode 2020-11-23 00:57:24 UTC
Github operator-framework operator-registry pull 505 None closed Bug 1889721: add skippatch unit test 2020-11-23 00:57:48 UTC

Description Kevin Rizza 2020-10-20 13:02:03 UTC
Description of problem:

When using semver-skippatch mode, opm should be automatically shortening the graph and skipping over non-latest patch versions to install the latest patch version of a package. Currently, this does not work correctly if a prerelease value is included in the version, as those versions are ignored and not skipped.

https://github.com/operator-framework/operator-registry/blob/master/pkg/registry/bundlegraphloader.go#L156-L158

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

4.5

How reproducible:

Always

Steps to Reproduce:
1. Add two bundles to an existing package in an index image, both with prerelease values and versions that otherwise match, using `index add --mode=semver-skippatch

Actual results:

Look at the resulting graph, noting that the lower of the two prerelease values is not skipped

Expected results:

The lower prerelease version should be skipped

Comment 1 Luiz Carvalho 2020-10-21 19:43:11 UTC
Any estimation of when this will be ready?

Comment 2 Nick Hale 2020-10-23 17:29:42 UTC
This has been approved and lgtmed and should merge today.

Comment 4 kuiwang 2020-10-29 02:00:07 UTC
verify it. Fail

more detailed at http://pastebin.test.redhat.com/913850 if it is not available, please refer to the below
same procedure.
--
build latest opm with the fix
[root@preserve-olm-env operator-registry]# git log -n 1
commit ec53e237005178062df26ca19a4827d788575f6a
Merge: 3cafc8d d8243c5
Author: OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>
Date:   Fri Oct 23 13:38:44 2020 -0400
 
    Merge pull request #486 from ankitathomas/skippatch-fix
   
    Bug 1889721: Check prerelease version for semver-skippatch mode
[root@preserve-olm-env operator-registry]# make clean;make build
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=ec53e23' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.14.3-29-gec53e23' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-10-27T01:12:18Z'"  -tags "json1" -o bin/opm ./cmd/opm
 
make bundle with version: 0.9.4, bundle is quay.io/kuiwang/etcd-bundle:v94ok
[root@preserve-olm-env operator-registry]# grep "version: " manifests/etcd/0.9.4/etcdoperator.v0.9.4.clusterserviceversion.yaml
        version: v1
        version: v1
      version: v1beta2
      version: v1beta2
      version: v1beta2
  version: 0.9.4
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/etcd/0.9.4 --tag quay.io/kuiwang/etcd-bundle:v94ok  -p etcd -c alpha -e alpha
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/etcd/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  266.6MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Running in 54ace51e808c
Removing intermediate container 54ace51e808c
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Running in b1a7b091ddb9
Removing intermediate container b1a7b091ddb9
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Running in b9583b3d1404
Removing intermediate container b9583b3d1404
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=etcd
 ---> Running in c12f4e935f6a
Removing intermediate container c12f4e935f6a
 ---> 7d81c3053b6d
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=alpha
 ---> Running in 24ad6dd39c9c
Removing intermediate container 24ad6dd39c9c
 ---> f873ae327c8d
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
 ---> Running in e42970fa2461
Removing intermediate container e42970fa2461
 ---> 8c67696b96a5
Step 8/9 : COPY manifests/etcd/0.9.4 /manifests/
 ---> c27b02ff63b8
Step 9/9 : COPY manifests/etcd/metadata /metadata/
 ---> 5d6e9604c912
Successfully built 5d6e9604c912
Successfully tagged quay.io/kuiwang/etcd-bundle:v94ok
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-bundle:v94ok
The push refers to repository [quay.io/kuiwang/etcd-bundle]
6a7efc05610c: Pushed
e45bb44ec43f: Pushed
v94ok: digest: sha256:c36465e79728c1ec70dc44ca70b3a64b6ebe1ba77aeca3c31a30c0eabf573883 size: 732
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/etcd/metadata
[root@preserve-olm-env operator-registry]#
 
 
make index with bundle quay.io/kuiwang/etcd-bundle:v94ok. index is quay.io/kuiwang/etcd-index:1889721
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/etcd-bundle:v94ok --tag quay.io/kuiwang/etcd-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-bundle:v94ok  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] Could not find optional dependencies file     dir=bundle_tmp188461297 file=bundle_tmp188461297/metadata load=annotations
INFO[0000] found csv, loading bundle                     dir=bundle_tmp188461297 file=bundle_tmp188461297/manifests load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp188461297/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp188461297/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp188461297/manifests file=etcdoperator.v0.9.4.clusterserviceversion.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp188461297/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] Generating dockerfile                         bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] writing dockerfile: index.Dockerfile789922343  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] running docker build                          bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] [docker build -f index.Dockerfile789922343 -t quay.io/kuiwang/etcd-index:1889721 .]  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-index:1889721
The push refers to repository [quay.io/kuiwang/etcd-index]
5053e9af7002: Pushed
14d454bac30e: Layer already exists
7a12ba9c099a: Layer already exists
371d4702865c: Layer already exists
4570b0d18853: Layer already exists
ace0eda3e3be: Layer already exists
1889721: digest: sha256:e1a170098d0f3db9925c01287b7b86380508fcf71ddce176be73b61203ff5ce7 size: 1578
 
change the 0.9.2 to 0.9.4-2 and make bundle quay.io/kuiwang/etcd-bundle:v92pv2
[root@preserve-olm-env operator-registry]# vi manifests/etcd/0.9.2/etcdoperator.v0.9.2.clusterserviceversion.yaml
[root@preserve-olm-env operator-registry]# grep "version: " manifests/etcd/0.9.2/etcdoperator.v0.9.2.clusterserviceversion.yaml
        version: v1
        version: v1
      version: v1beta2
      version: v1beta2
      version: v1beta2
  version: 0.9.4-2
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/etcd/0.9.2 --tag quay.io/kuiwang/etcd-bundle:v92pv2  -p etcd -c alpha -e alpha
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/etcd/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  266.6MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=etcd
 ---> Using cache
 ---> 7d81c3053b6d
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=alpha
 ---> Using cache
 ---> f873ae327c8d
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
 ---> Using cache
 ---> 8c67696b96a5
Step 8/9 : COPY manifests/etcd/0.9.2 /manifests/
 ---> a5e2903a06e0
Step 9/9 : COPY manifests/etcd/metadata /metadata/
 ---> ee90d4e834f8
Successfully built ee90d4e834f8
Successfully tagged quay.io/kuiwang/etcd-bundle:v92pv2
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-bundle:v92pv2
The push refers to repository [quay.io/kuiwang/etcd-bundle]
69f622e50bc1: Pushed
45c9335f068e: Pushed
v92pv2: digest: sha256:d11977a6e227f3750b2922c41aeaef7ac2c5e7c606f630c49513d6dce52d1c13 size: 732
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/etcd/metadata
[root@preserve-olm-env operator-registry]#
 
add bundle quay.io/kuiwang/etcd-bundle:v92pv2 into index quay.io/kuiwang/etcd-index:1889721
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/etcd-bundle:v92pv2  --from-index quay.io/kuiwang/etcd-index:1889721 --tag quay.io/kuiwang/etcd-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0000] Pulling previous image quay.io/kuiwang/etcd-index:1889721 to get metadata  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:1889721  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:1889721  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/etcd-bundle:v92pv2  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp725697633 file=bundle_tmp725697633/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp725697633 file=bundle_tmp725697633/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp725697633/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp725697633/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp725697633/manifests file=etcdoperator.v0.9.2.clusterserviceversion.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp725697633/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] writing dockerfile: index.Dockerfile336633367  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] [docker build -f index.Dockerfile336633367 -t quay.io/kuiwang/etcd-index:1889721 .]  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-index:1889721
The push refers to repository [quay.io/kuiwang/etcd-index]
de85effca1a3: Pushed
14d454bac30e: Layer already exists
7a12ba9c099a: Layer already exists
371d4702865c: Layer already exists
4570b0d18853: Layer already exists
ace0eda3e3be: Layer already exists
1889721: digest: sha256:648cc429efb5cf6af9d54969e5370a69f95b65989d8e7598e01658e004637549 size: 1578
 
change 0.9.0 to 0.9.4-1 and make bundle quay.io/kuiwang/etcd-bundle:v90pv1
[root@preserve-olm-env operator-registry]# vi manifests/etcd/0.9.0/etcdoperator.v0.9.0.clusterserviceversion.yaml
[root@preserve-olm-env operator-registry]# grep "version: " manifests/etcd/0.9.0/etcdoperator.v0.9.0.clusterserviceversion.yaml
        version: v1
        version: v1
      version: v1beta2
      version: v1beta2
      version: v1beta2
  version: 0.9.4-1
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/etcd/0.9.0 --tag quay.io/kuiwang/etcd-bundle:v90pv1  -p etcd -c alpha -e alpha
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/etcd/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  266.6MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=etcd
 ---> Using cache
 ---> 7d81c3053b6d
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=alpha
 ---> Using cache
 ---> f873ae327c8d
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
 ---> Using cache
 ---> 8c67696b96a5
Step 8/9 : COPY manifests/etcd/0.9.0 /manifests/
 ---> c6f028df09d2
Step 9/9 : COPY manifests/etcd/metadata /metadata/
 ---> f829fc2fd270
Successfully built f829fc2fd270
Successfully tagged quay.io/kuiwang/etcd-bundle:v90pv1
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-bundle:v90pv1
The push refers to repository [quay.io/kuiwang/etcd-bundle]
cba3f2695d5e: Pushed
1c3b27598995: Pushed
v90pv1: digest: sha256:e101fdafbe0e3d766131361ce60978e76f9e92c82705d6f80d32ec88b896346e size: 732
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/etcd/metadata/
[root@preserve-olm-env operator-registry]#
 
add bundle quay.io/kuiwang/etcd-bundle:v90pv1 into index quay.io/kuiwang/etcd-index:1889721
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/etcd-bundle:v90pv1 --from-index quay.io/kuiwang/etcd-index:1889721 --tag quay.io/kuiwang/etcd-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] Pulling previous image quay.io/kuiwang/etcd-index:1889721 to get metadata  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:1889721  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:1889721  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/etcd-bundle:v90pv1  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp504773907 file=bundle_tmp504773907/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp504773907 file=bundle_tmp504773907/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp504773907/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp504773907/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp504773907/manifests file=etcdoperator.v0.9.0.clusterserviceversion.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp504773907/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0002] writing dockerfile: index.Dockerfile500842105  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0002] [docker build -f index.Dockerfile500842105 -t quay.io/kuiwang/etcd-index:1889721 .]  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-index:1889721
The push refers to repository [quay.io/kuiwang/etcd-index]
0a413b009265: Pushed
14d454bac30e: Layer already exists
7a12ba9c099a: Layer already exists
371d4702865c: Layer already exists
4570b0d18853: Layer already exists
ace0eda3e3be: Layer already exists
1889721: digest: sha256:0c4e036b29c95ca7ad86f9d0bb8c79b31d4041b34ae20ea85fba1e80cfcfd3fb size: 1578
 
 
create catalogsource with quay.io/kuiwang/etcd-index:1889721
[root@preserve-olm-env 1889721]# cat catsrcv1.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: olm-1933-v1-catalog
  namespace: default
spec:
  displayName: OLM 1933 Operator Catalog
  image: quay.io/kuiwang/etcd-index:1889721
  icon:
    base64data: ""
    mediatype: ""
  publisher: QE
  sourceType: grpc
  updateStrategy:
    registryPoll:
      interval: 2m0s
[root@preserve-olm-env 1889721]# oc apply -f catsrcv1.yaml
catalogsource.operators.coreos.com/olm-1933-v1-catalog created
 
create og
[root@preserve-olm-env 1889721]# cat og-single.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1889721]# oc apply -f og-single.yaml
operatorgroup.operators.coreos.com/og-single1 unchanged
 
 
install etcd from etcdoperator.v0.9.0, expect it directly to install 0.9.4
[root@preserve-olm-env 1889721]# oc apply -f sub-etcd1.yaml
subscription.operators.coreos.com/etcd created
 
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.0   etcd      0.9.4-1                         Installing
etcdoperator.v0.9.2   etcd      0.9.4-2   etcdoperator.v0.9.0   Pending
 
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.0   etcd      0.9.4-1                         Failed
etcdoperator.v0.9.2   etcd      0.9.4-2   etcdoperator.v0.9.0   Pending
 
[root@preserve-olm-env 1889721]# oc logs catalog-operator-646755fb4c-99npt -n openshift-operator-lifecycle-manager
E1029 01:44:08.565014       1 queueinformer_operator.go:290] sync "default" failed: constraints not satisfiable: @existing/default//etcdoperator.v0.9.0 is mandatory, pkgunique/etcd permits at most 1 of @existing/default//etcdoperator.v0.9.0, @existing/default//etcdoperator.v0.9.2, olm-1933-v1-catalog/default/alpha/etcdoperator.v0.9.4, etcd is mandatory, etcd requires at least one of olm-1933-v1-catalog/default/alpha/etcdoperator.v0.9.4, @existing/default//etcdoperator.v0.9.2
 
but we met two issues:
1, it seems still try to install etcdoperator.v0.9.0 and then etcdoperator.v0.9.2, then etcdoperator.v0.9.4. not directly to etcdoperator.v0.9.4
2, it fails to install etcdoperator.v0.9.0 with above error.
Could you please check what I did wrong or it is not fixed? Thanks
--

Comment 5 Ankita Thomas 2020-10-30 11:44:03 UTC
I see this in the test index used

SELECT name, version, replaces, csv FROM operatorbundle;

| name                | version | replaces            | csv
| etcdoperator.v0.9.4 | 0.9.4   | etcdoperator.v0.9.2 | {"apiVersion":"oper...
| etcdoperator.v0.9.2 | 0.9.4-2 | etcdoperator.v0.9.0 | NULL
| etcdoperator.v0.9.0 | 0.9.4-1 |                     | NULL

The order in which the bundles were added to the index was 0.9.4, 0.9.4-2, 0.9.4-1 which goes from greatest to smallest semver versions.

semver-skippatch skips only smaller patch versions when a new bundle is added to the index. The test should be adding the bundles in reverse order, 0.9.4-1, 0.9.4-2, 0.9.4

Comment 8 kuiwang 2020-11-02 06:04:36 UTC
Hi,

  with the latest opm, we get different behavior. the operator installation succeed, but it does not skip 0.9.4-1 and 0.9.4-2.

--
[root@preserve-olm-env operator-registry]# git log -n 1
commit fc70c12eae1948404bffebbfe1546b37eda94dd9
Merge: f83ace4 f76fdae
Author: OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>
Date:   Thu Oct 29 22:00:24 2020 +0100

    Merge pull request #501 from benluddy/upstream-release-go-114
    
    Build upstream releases with Go 1.14 instead of 1.15.
[root@preserve-olm-env operator-registry]# make build
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=fc70c12' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.14.3-45-gfc70c12' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-11-02T05:12:07Z'"  -tags "json1" -o bin/opm ./cmd/opm


[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/etcd-bundle:v90pv1 --tag quay.io/kuiwang/etcd-index:rvert1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-bundle:v90pv1  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0000] Could not find optional dependencies file     dir=bundle_tmp747043294 file=bundle_tmp747043294/metadata load=annotations
INFO[0000] found csv, loading bundle                     dir=bundle_tmp747043294 file=bundle_tmp747043294/manifests load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp747043294/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp747043294/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp747043294/manifests file=etcdoperator.v0.9.0.clusterserviceversion.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp747043294/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0001] Generating dockerfile                         bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] writing dockerfile: index.Dockerfile705105100  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] running docker build                          bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
INFO[0001] [docker build -f index.Dockerfile705105100 -t quay.io/kuiwang/etcd-index:rvert1889721 .]  bundles="[quay.io/kuiwang/etcd-bundle:v90pv1]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-index:rvert1889721
The push refers to repository [quay.io/kuiwang/etcd-index]
df52e699419c: Pushed 
14d454bac30e: Layer already exists 
7a12ba9c099a: Layer already exists 
371d4702865c: Layer already exists 
4570b0d18853: Layer already exists 
ace0eda3e3be: Layer already exists 
rvert1889721: digest: sha256:ade1f361dde27f86cee63e38b970fc0ad4752162b399a235e7105d078158e3e9 size: 1578
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/etcd-bundle:v92pv2  --from-index quay.io/kuiwang/etcd-index:rvert1889721 --tag quay.io/kuiwang/etcd-index:rvert1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0000] Pulling previous image quay.io/kuiwang/etcd-index:rvert1889721 to get metadata  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:rvert1889721  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:rvert1889721  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/etcd-bundle:v92pv2  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp330152409 file=bundle_tmp330152409/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp330152409 file=bundle_tmp330152409/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp330152409/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp330152409/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp330152409/manifests file=etcdoperator.v0.9.2.clusterserviceversion.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp330152409/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] writing dockerfile: index.Dockerfile712810191  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
INFO[0002] [docker build -f index.Dockerfile712810191 -t quay.io/kuiwang/etcd-index:rvert1889721 .]  bundles="[quay.io/kuiwang/etcd-bundle:v92pv2]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-index:rvert1889721
The push refers to repository [quay.io/kuiwang/etcd-index]
ba9d24d9d50e: Pushed 
14d454bac30e: Layer already exists 
7a12ba9c099a: Layer already exists 
371d4702865c: Layer already exists 
4570b0d18853: Layer already exists 
ace0eda3e3be: Layer already exists 
rvert1889721: digest: sha256:4cb00d27c8260808f923940de9892d03cab52992b58a1d15a11aa5a8220f8ff8 size: 1578
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/etcd-bundle:v94ok  --from-index quay.io/kuiwang/etcd-index:rvert1889721 --tag quay.io/kuiwang/etcd-index:rvert1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] Pulling previous image quay.io/kuiwang/etcd-index:rvert1889721 to get metadata  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:rvert1889721  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/etcd-index:rvert1889721  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/etcd-bundle:v94ok  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp240267088 file=bundle_tmp240267088/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp240267088 file=bundle_tmp240267088/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp240267088/manifests file=etcdbackups.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp240267088/manifests file=etcdclusters.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp240267088/manifests file=etcdoperator.v0.9.4.clusterserviceversion.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp240267088/manifests file=etcdrestores.etcd.database.coreos.com.crd.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0002] writing dockerfile: index.Dockerfile629152750  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
INFO[0002] [docker build -f index.Dockerfile629152750 -t quay.io/kuiwang/etcd-index:rvert1889721 .]  bundles="[quay.io/kuiwang/etcd-bundle:v94ok]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/etcd-index:rvert1889721
The push refers to repository [quay.io/kuiwang/etcd-index]
4a72bd0a49a4: Pushed 
14d454bac30e: Layer already exists 
7a12ba9c099a: Layer already exists 
371d4702865c: Layer already exists 
4570b0d18853: Layer already exists 
ace0eda3e3be: Layer already exists 
rvert1889721: digest: sha256:787d54012a00b8e02f5e513246f103497ccc66e131fec8573a93d3f9e9e3283a size: 1578
[root@preserve-olm-env operator-registry]# docker create quay.io/kuiwang/etcd-index:rvert1889721
b704a3af5e876dfe950cb19546391b8baefba5b6f5e30f2d28f270525a6926cf
[root@preserve-olm-env operator-registry]# docker cp b704a3af5e876dfe950cb19546391b8baefba5b6f5e30f2d28f270525a6926cf:/database/index.db .
[root@preserve-olm-env operator-registry]# 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.table
Error: unknown command or invalid arguments:  "table.table". Enter ".help" for help
sqlite> .table
api                channel            operatorbundle     related_image    
api_provider       channel_entry      package            schema_migrations
api_requirer       dependencies       properties       
sqlite> SELECT name, version, replaces, csv FROM operatorbundle;
name                 version     replaces    csv       
-------------------  ----------  ----------  ----------
etcdoperator.v0.9.0  0.9.4-1                           
etcdoperator.v0.9.2  0.9.4-2     etcdoperat            
etcdoperator.v0.9.4  0.9.4       etcdoperat  {"apiVersi
sqlite> select name, replaces from operatorbundle;
name                 replaces  
-------------------  ----------
etcdoperator.v0.9.0            
etcdoperator.v0.9.2  etcdoperat
etcdoperator.v0.9.4  etcdoperat
sqlite> select entry_id, replaces, operatorbundle_name from channel_entry;
entry_id    replaces    operatorbundle_name
----------  ----------  -------------------
1                       etcdoperator.v0.9.4
2                       etcdoperator.v0.9.2
3           2           etcdoperator.v0.9.4
4                       etcdoperator.v0.9.0
5           4           etcdoperator.v0.9.4
sqlite> .exit

[root@preserve-olm-env 1889721]# cat og-single.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1889721]# oc apply -f og-single.yaml
operatorgroup.operators.coreos.com/og-single1 created

[root@preserve-olm-env 1889721]# cat revertcatsrc.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: olm-1933-v1-catalog
  namespace: default
spec:
  displayName: OLM 1933 Operator Catalog
  image: quay.io/kuiwang/etcd-index:rvert1889721
  icon:
    base64data: ""
    mediatype: ""
  publisher: QE
  sourceType: grpc
  updateStrategy:
    registryPoll:
      interval: 2m0s
[root@preserve-olm-env 1889721]# oc apply -f revertcatsrc.yaml 
catalogsource.operators.coreos.com/olm-1933-v1-catalog created
[root@preserve-olm-env 1889721]# oc get pod
NAME                        READY   STATUS    RESTARTS   AGE
olm-1933-v1-catalog-8mndd   0/1     Running   0          9s
[root@preserve-olm-env 1889721]# oc get pod
NAME                        READY   STATUS    RESTARTS   AGE
olm-1933-v1-catalog-8mndd   1/1     Running   0          17s

[root@preserve-olm-env 1889721]# cat revert-sub-etcd1.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: etcd
  namespace: default
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: etcd
  source: olm-1933-v1-catalog
  sourceNamespace: default
  startingCSV: etcdoperator.v0.9.0
[root@preserve-olm-env 1889721]# oc apply -f revert-sub-etcd1.yaml 
subscription.operators.coreos.com/etcd created
[root@preserve-olm-env 1889721]# oc get csv
No resources found in default namespace.
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES   PHASE
etcdoperator.v0.9.0   etcd      0.9.4-1              Installing
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES   PHASE
etcdoperator.v0.9.0   etcd      0.9.4-1              Installing
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.2   etcd      0.9.4-2   etcdoperator.v0.9.0   Succeeded
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.2   etcd      0.9.4-2   etcdoperator.v0.9.0   Replacing
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Installing
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.2   etcd      0.9.4-2   etcdoperator.v0.9.0   Replacing
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Installing
[root@preserve-olm-env 1889721]# oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded
[root@preserve-olm-env 1889721]# 

the installation succeed, but it does not directly to install 0.9.4, but install 0.9.4-1->0.9.4-2->0.9.4

--

Comment 9 kuiwang 2020-11-11 05:11:55 UTC
[root@preserve-olm-env operator-registry]# git branch
* master
  release-4.6
[root@preserve-olm-env operator-registry]# git pull origin master
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 6 (delta 3), reused 3 (delta 3), pack-reused 3
Unpacking objects: 100% (6/6), done.
From github.com:operator-framework/operator-registry
 * branch            master     -> FETCH_HEAD
Updating e12d039..bfe56a7
Fast-forward
 .github/workflows/release.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[root@preserve-olm-env operator-registry]# git log -n 1
commit bfe56a7c275dff1ecf5f700df48719300ea0b8a5
Merge: e12d039 70ae9cf
Author: OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>
Date:   Wed Nov 4 16:14:04 2020 +0100
 
    Merge pull request #508 from benluddy/fix-go-114
   
    Fix Go version used by release job to 1.14.z.
[root@preserve-olm-env operator-registry]# make clean
[root@preserve-olm-env operator-registry]# make build
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=bfe56a7' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.14.3-49-gbfe56a7' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-11-05T01:20:23Z'"  -tags "json1" -o bin/opm ./cmd/opm
[root@preserve-olm-env operator-registry]#
 
 
 
[root@preserve-olm-env operator-registry]# grep "version: " manifests/teiid-1889721/0.2.0/teiid.v0.2.0.clusterserviceversion.yaml
        version: v1alpha1
  version: 0.2.0
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889721/0.2.0 --tag quay.io/kuiwang/teiid-operator:v0.2.0 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1889721/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  267.2MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Running in f1bc23a5e49b
Removing intermediate container f1bc23a5e49b
 ---> 22214f60fec7
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Running in ba9719d15203
Removing intermediate container ba9719d15203
 ---> 5db6d5c231b7
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Running in ac8d689e06ef
Removing intermediate container ac8d689e06ef
 ---> f9c2abe36d33
Step 8/9 : COPY manifests/teiid-1889721/0.2.0 /manifests/
 ---> 70d47bdd0ec3
Step 9/9 : COPY manifests/teiid-1889721/metadata /metadata/
 ---> a9ff9248812e
Successfully built a9ff9248812e
Successfully tagged quay.io/kuiwang/teiid-operator:v0.2.0
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v0.2.0
The push refers to repository [quay.io/kuiwang/teiid-operator]
33c83423b6eb: Pushed
e481667e3f7a: Pushed
v0.2.0: digest: sha256:09790f92d2eab9ee625ecba3fd2d07ecb540b1c1904d6d0dd839cb16fa8b2b5e size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889721/metadata
[root@preserve-olm-env operator-registry]#
 
 
 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v0.2.0 --tag quay.io/kuiwang/teiid-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v0.2.0  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] Could not find optional dependencies file     dir=bundle_tmp843330103 file=bundle_tmp843330103/metadata load=annotations
INFO[0000] found csv, loading bundle                     dir=bundle_tmp843330103 file=bundle_tmp843330103/manifests load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp843330103/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp843330103/manifests file=teiid.v0.2.0.clusterserviceversion.yaml load=bundle
INFO[0001] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0001] writing dockerfile: index.Dockerfile519055613  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0001] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0001] [docker build -f index.Dockerfile519055613 -t quay.io/kuiwang/teiid-index:1889721 .]  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1889721
The push refers to repository [quay.io/kuiwang/teiid-index]
c761bf1eeae5: Pushed
14d454bac30e: Mounted from kuiwang/depcatalogs-index
7a12ba9c099a: Mounted from kuiwang/depcatalogs-index
371d4702865c: Mounted from kuiwang/depcatalogs-index
4570b0d18853: Mounted from kuiwang/depcatalogs-index
ace0eda3e3be: Mounted from kuiwang/depcatalogs-index
1889721: digest: sha256:793c1bcd6e3b1fbbe0de0a862d7f0d77610802cba833fd428dd3a43338332403 size: 1578
[root@preserve-olm-env operator-registry]#
 
 
[root@preserve-olm-env operator-registry]# grep "version: " manifests/teiid-1889721/0.3.0/teiid.v0.3.0.clusterserviceversion.yaml
        version: v1alpha1
  version: 0.2.0-1
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889721/0.3.0 --tag quay.io/kuiwang/teiid-operator:v0.2.0-1 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1889721/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  267.2MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Using cache
 ---> 22214f60fec7
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Using cache
 ---> 5db6d5c231b7
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Using cache
 ---> f9c2abe36d33
Step 8/9 : COPY manifests/teiid-1889721/0.3.0 /manifests/
 ---> c3676200fbc6
Step 9/9 : COPY manifests/teiid-1889721/metadata /metadata/
 ---> e8c8d5f82fa7
Successfully built e8c8d5f82fa7
Successfully tagged quay.io/kuiwang/teiid-operator:v0.2.0-1
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v0.2.0-1
The push refers to repository [quay.io/kuiwang/teiid-operator]
74c0023a0a2a: Pushed
6f7ba9a1335a: Pushed
v0.2.0-1: digest: sha256:08d62ad3a52a7fb6cbbe8ea1c599f645abee6ec94343faabdb70e25328c6430e size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889721/metadata
[root@preserve-olm-env operator-registry]#
 
 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v0.2.0-1 --from-index quay.io/kuiwang/teiid-index:1889721 --tag quay.io/kuiwang/teiid-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0000] Pulling previous image quay.io/kuiwang/teiid-index:1889721 to get metadata  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v0.2.0-1  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp223498522 file=bundle_tmp223498522/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp223498522 file=bundle_tmp223498522/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp223498522/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp223498522/manifests file=teiid.v0.3.0.clusterserviceversion.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] writing dockerfile: index.Dockerfile257487272  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] [docker build -f index.Dockerfile257487272 -t quay.io/kuiwang/teiid-index:1889721 .]  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1889721
The push refers to repository [quay.io/kuiwang/teiid-index]
bce232c48a4c: Pushed
14d454bac30e: Layer already exists
7a12ba9c099a: Layer already exists
371d4702865c: Layer already exists
4570b0d18853: Layer already exists
ace0eda3e3be: Layer already exists
1889721: digest: sha256:92382ff9b02445dba5852f1b43d5716a74c998b4282b9815a0343958212ab4fa size: 1578
 
 
[root@preserve-olm-env operator-registry]# grep "version: " manifests/teiid-1889721/0.4.0/teiid.v0.4.0.clusterserviceversion.yaml
      version: v1alpha1
  version: 0.2.0-2
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889721/0.4.0 --tag quay.io/kuiwang/teiid-operator:v0.2.0-2 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1889721/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  267.2MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Using cache
 ---> 22214f60fec7
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Using cache
 ---> 5db6d5c231b7
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Using cache
 ---> f9c2abe36d33
Step 8/9 : COPY manifests/teiid-1889721/0.4.0 /manifests/
 ---> cdc81c66055a
Step 9/9 : COPY manifests/teiid-1889721/metadata /metadata/
 ---> 71dc76119a7f
Successfully built 71dc76119a7f
Successfully tagged quay.io/kuiwang/teiid-operator:v0.2.0-2
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v0.2.0-2
The push refers to repository [quay.io/kuiwang/teiid-operator]
1a4bde0c1c80: Pushed
87bd93abe082: Pushed
v0.2.0-2: digest: sha256:3173fdd013b3e35a22d37861cd99f4aec6391fc31d0f220529e15492b4aa0bfc size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889721/metadata
[root@preserve-olm-env operator-registry]#
 
 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v0.2.0-2 --from-index quay.io/kuiwang/teiid-index:1889721 --tag quay.io/kuiwang/teiid-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0000] Pulling previous image quay.io/kuiwang/teiid-index:1889721 to get metadata  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v0.2.0-2  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp816563113 file=bundle_tmp816563113/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp816563113 file=bundle_tmp816563113/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp816563113/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp816563113/manifests file=teiid.v0.4.0.clusterserviceversion.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] writing dockerfile: index.Dockerfile387263519  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] [docker build -f index.Dockerfile387263519 -t quay.io/kuiwang/teiid-index:1889721 .]  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1889721
The push refers to repository [quay.io/kuiwang/teiid-index]
669d7c1f938f: Pushed
14d454bac30e: Layer already exists
7a12ba9c099a: Layer already exists
371d4702865c: Layer already exists
4570b0d18853: Layer already exists
ace0eda3e3be: Layer already exists
1889721: digest: sha256:cac4faa02d3d53e91ab4ff16359fc6863c31d0f525fe28c79d9f20da5b143b2f size: 1578
[root@preserve-olm-env operator-registry]#
 
[root@preserve-olm-env operator-registry]# docker create quay.io/kuiwang/teiid-index:1889721
f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9
[root@preserve-olm-env operator-registry]# rm -fr index.db
[root@preserve-olm-env operator-registry]# docker cp f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9:/database/index.db .
[root@preserve-olm-env operator-registry]# docker rm f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9
f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9
[root@preserve-olm-env operator-registry]# 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> SELECT name, version, replaces FROM operatorbundle;
name          version     replaces  
------------  ----------  ----------
teiid.v0.2.0  0.2.0                
teiid.v0.3.0  0.2.0-1     teiid.v0.2
teiid.v0.4.0  0.2.0-2     teiid.v0.3
sqlite> select name, replaces from operatorbundle;
name          replaces  
------------  ----------
teiid.v0.2.0            
teiid.v0.3.0  teiid.v0.2
teiid.v0.4.0  teiid.v0.3
sqlite> select entry_id, replaces, operatorbundle_name from channel_entry;
entry_id    replaces    operatorbundle_name
----------  ----------  -------------------
1           2           teiid.v0.2.0      
2                       teiid.v0.4.0      
3                       teiid.v0.3.0      
4           3           teiid.v0.4.0      
sqlite> .exit
[root@preserve-olm-env operator-registry]#
 
 
[root@preserve-olm-env 1889721]# cat og-single.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1889721]# oc apply -f og-single.yaml
operatorgroup.operators.coreos.com/og-single1 created
[root@preserve-olm-env 1889721]# cat catsrcteiid.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: olm-1933-v1-catalog
  namespace: default
spec:
  displayName: OLM 1933 Operator Catalog
  image: quay.io/kuiwang/teiid-index:1889721
  icon:
    base64data: ""
    mediatype: ""
  publisher: QE
  sourceType: grpc
  updateStrategy:
    registryPoll:
      interval: 2m0s
[root@preserve-olm-env 1889721]# oc apply -f catsrcteiid.yaml
catalogsource.operators.coreos.com/olm-1933-v1-catalog created
[root@preserve-olm-env 1889721]# oc get pod
NAME                        READY   STATUS              RESTARTS   AGE
olm-1933-v1-catalog-gv6m8   0/1     ContainerCreating   0          5s
[root@preserve-olm-env 1889721]# oc get pod
NAME                        READY   STATUS    RESTARTS   AGE
olm-1933-v1-catalog-gv6m8   1/1     Running   0          109s
[root@preserve-olm-env 1889721]#
 
 
[root@preserve-olm-env 1889721]# cat sub-t.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: teiid
  namespace: default
spec:
  channel: beta
  installPlanApproval: Automatic
  name: teiid
  source: olm-1933-v1-catalog
  sourceNamespace: default
  startingCSV: teiid.v0.2.0
[root@preserve-olm-env 1889721]# oc apply -f sub-t.yaml
subscription.operators.coreos.com/teiid created
[root@preserve-olm-env 1889721]#
 
[root@preserve-olm-env 1889721]# oc get sub
NAME    PACKAGE   SOURCE                CHANNEL
teiid   teiid     olm-1933-v1-catalog   beta
[root@preserve-olm-env 1889721]# oc get ip
NAME            CSV            APPROVAL    APPROVED
install-4vhbd   teiid.v0.2.0   Automatic   true
[root@preserve-olm-env 1889721]# oc get csv
No resources found in default namespace.
[root@preserve-olm-env 1889721]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.2.0   Teiid     0.2.0                Installing
[root@preserve-olm-env 1889721]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.2.0   Teiid     0.2.0                Installing
[root@preserve-olm-env 1889721]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.2.0   Teiid     0.2.0                Succeeded
[root@preserve-olm-env 1889721]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.2.0   Teiid     0.2.0                Succeeded

Comment 10 Kevin Rizza 2020-11-12 17:43:09 UTC
I think we can't properly verify this in 4.7 without https://bugzilla.redhat.com/show_bug.cgi?id=1889388 merging first, since the new resolver isn't properly respecting the extra edges in the update graph.

Comment 12 kuiwang 2020-11-18 07:05:56 UTC
verify it on 4.7. LGTM

--
[root@preserve-olm-env operator-registry]# git branch
* master
  release-4.6
[root@preserve-olm-env operator-registry]# git pull origin master
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 6 (delta 3), reused 3 (delta 3), pack-reused 3
Unpacking objects: 100% (6/6), done.
From github.com:operator-framework/operator-registry
 * branch            master     -> FETCH_HEAD
Updating e12d039..bfe56a7
Fast-forward
 .github/workflows/release.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
[root@preserve-olm-env operator-registry]# git log -n 1
commit bfe56a7c275dff1ecf5f700df48719300ea0b8a5
Merge: e12d039 70ae9cf
Author: OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>
Date:   Wed Nov 4 16:14:04 2020 +0100
 
    Merge pull request #508 from benluddy/fix-go-114
   
    Fix Go version used by release job to 1.14.z.
[root@preserve-olm-env operator-registry]# make clean
[root@preserve-olm-env operator-registry]# make build
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=bfe56a7' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.opmVersion=v1.14.3-49-gbfe56a7' -X 'github.com/operator-framework/operator-registry/cmd/opm/version.buildDate=2020-11-05T01:20:23Z'"  -tags "json1" -o bin/opm ./cmd/opm
[root@preserve-olm-env operator-registry]#
 
 
 
[root@preserve-olm-env operator-registry]# grep "version: " manifests/teiid-1889721/0.2.0/teiid.v0.2.0.clusterserviceversion.yaml
        version: v1alpha1
  version: 0.2.0
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889721/0.2.0 --tag quay.io/kuiwang/teiid-operator:v0.2.0 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1889721/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  267.2MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Running in f1bc23a5e49b
Removing intermediate container f1bc23a5e49b
 ---> 22214f60fec7
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Running in ba9719d15203
Removing intermediate container ba9719d15203
 ---> 5db6d5c231b7
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Running in ac8d689e06ef
Removing intermediate container ac8d689e06ef
 ---> f9c2abe36d33
Step 8/9 : COPY manifests/teiid-1889721/0.2.0 /manifests/
 ---> 70d47bdd0ec3
Step 9/9 : COPY manifests/teiid-1889721/metadata /metadata/
 ---> a9ff9248812e
Successfully built a9ff9248812e
Successfully tagged quay.io/kuiwang/teiid-operator:v0.2.0
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v0.2.0
The push refers to repository [quay.io/kuiwang/teiid-operator]
33c83423b6eb: Pushed
e481667e3f7a: Pushed
v0.2.0: digest: sha256:09790f92d2eab9ee625ecba3fd2d07ecb540b1c1904d6d0dd839cb16fa8b2b5e size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889721/metadata
[root@preserve-olm-env operator-registry]#
 
 
 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v0.2.0 --tag quay.io/kuiwang/teiid-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v0.2.0  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0000] Could not find optional dependencies file     dir=bundle_tmp843330103 file=bundle_tmp843330103/metadata load=annotations
INFO[0000] found csv, loading bundle                     dir=bundle_tmp843330103 file=bundle_tmp843330103/manifests load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp843330103/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0000] loading bundle file                           dir=bundle_tmp843330103/manifests file=teiid.v0.2.0.clusterserviceversion.yaml load=bundle
INFO[0001] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0001] writing dockerfile: index.Dockerfile519055613  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0001] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
INFO[0001] [docker build -f index.Dockerfile519055613 -t quay.io/kuiwang/teiid-index:1889721 .]  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1889721
The push refers to repository [quay.io/kuiwang/teiid-index]
c761bf1eeae5: Pushed
14d454bac30e: Mounted from kuiwang/depcatalogs-index
7a12ba9c099a: Mounted from kuiwang/depcatalogs-index
371d4702865c: Mounted from kuiwang/depcatalogs-index
4570b0d18853: Mounted from kuiwang/depcatalogs-index
ace0eda3e3be: Mounted from kuiwang/depcatalogs-index
1889721: digest: sha256:793c1bcd6e3b1fbbe0de0a862d7f0d77610802cba833fd428dd3a43338332403 size: 1578
[root@preserve-olm-env operator-registry]#
 
 
[root@preserve-olm-env operator-registry]# grep "version: " manifests/teiid-1889721/0.3.0/teiid.v0.3.0.clusterserviceversion.yaml
        version: v1alpha1
  version: 0.2.0-1
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889721/0.3.0 --tag quay.io/kuiwang/teiid-operator:v0.2.0-1 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1889721/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  267.2MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Using cache
 ---> 22214f60fec7
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Using cache
 ---> 5db6d5c231b7
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Using cache
 ---> f9c2abe36d33
Step 8/9 : COPY manifests/teiid-1889721/0.3.0 /manifests/
 ---> c3676200fbc6
Step 9/9 : COPY manifests/teiid-1889721/metadata /metadata/
 ---> e8c8d5f82fa7
Successfully built e8c8d5f82fa7
Successfully tagged quay.io/kuiwang/teiid-operator:v0.2.0-1
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v0.2.0-1
The push refers to repository [quay.io/kuiwang/teiid-operator]
74c0023a0a2a: Pushed
6f7ba9a1335a: Pushed
v0.2.0-1: digest: sha256:08d62ad3a52a7fb6cbbe8ea1c599f645abee6ec94343faabdb70e25328c6430e size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889721/metadata
[root@preserve-olm-env operator-registry]#
 
 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v0.2.0-1 --from-index quay.io/kuiwang/teiid-index:1889721 --tag quay.io/kuiwang/teiid-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0000] Pulling previous image quay.io/kuiwang/teiid-index:1889721 to get metadata  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v0.2.0-1  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp223498522 file=bundle_tmp223498522/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp223498522 file=bundle_tmp223498522/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp223498522/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp223498522/manifests file=teiid.v0.3.0.clusterserviceversion.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] writing dockerfile: index.Dockerfile257487272  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
INFO[0002] [docker build -f index.Dockerfile257487272 -t quay.io/kuiwang/teiid-index:1889721 .]  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-1]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1889721
The push refers to repository [quay.io/kuiwang/teiid-index]
bce232c48a4c: Pushed
14d454bac30e: Layer already exists
7a12ba9c099a: Layer already exists
371d4702865c: Layer already exists
4570b0d18853: Layer already exists
ace0eda3e3be: Layer already exists
1889721: digest: sha256:92382ff9b02445dba5852f1b43d5716a74c998b4282b9815a0343958212ab4fa size: 1578
 
 
[root@preserve-olm-env operator-registry]# grep "version: " manifests/teiid-1889721/0.4.0/teiid.v0.4.0.clusterserviceversion.yaml
      version: v1alpha1
  version: 0.2.0-2
[root@preserve-olm-env operator-registry]# ./bin/opm alpha bundle build --directory /root/kuiwang/operator-registry/manifests/teiid-1889721/0.4.0 --tag quay.io/kuiwang/teiid-operator:v0.2.0-2 -p teiid -c beta -e beta
INFO[0000] Building annotations.yaml                    
INFO[0000] Writing annotations.yaml in /root/kuiwang/operator-registry/manifests/teiid-1889721/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  267.2MB
Step 1/9 : FROM scratch
 --->
Step 2/9 : LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
 ---> Using cache
 ---> e4b01c2bb11d
Step 3/9 : LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
 ---> Using cache
 ---> 05191049f5aa
Step 4/9 : LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
 ---> Using cache
 ---> 131eef1021c4
Step 5/9 : LABEL operators.operatorframework.io.bundle.package.v1=teiid
 ---> Using cache
 ---> 22214f60fec7
Step 6/9 : LABEL operators.operatorframework.io.bundle.channels.v1=beta
 ---> Using cache
 ---> 5db6d5c231b7
Step 7/9 : LABEL operators.operatorframework.io.bundle.channel.default.v1=beta
 ---> Using cache
 ---> f9c2abe36d33
Step 8/9 : COPY manifests/teiid-1889721/0.4.0 /manifests/
 ---> cdc81c66055a
Step 9/9 : COPY manifests/teiid-1889721/metadata /metadata/
 ---> 71dc76119a7f
Successfully built 71dc76119a7f
Successfully tagged quay.io/kuiwang/teiid-operator:v0.2.0-2
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-operator:v0.2.0-2
The push refers to repository [quay.io/kuiwang/teiid-operator]
1a4bde0c1c80: Pushed
87bd93abe082: Pushed
v0.2.0-2: digest: sha256:3173fdd013b3e35a22d37861cd99f4aec6391fc31d0f220529e15492b4aa0bfc size: 733
[root@preserve-olm-env operator-registry]# rm -fr bundle.Dockerfile manifests/teiid-1889721/metadata
[root@preserve-olm-env operator-registry]#
 
 
[root@preserve-olm-env operator-registry]# ./bin/opm index add --bundles quay.io/kuiwang/teiid-operator:v0.2.0-2 --from-index quay.io/kuiwang/teiid-index:1889721 --tag quay.io/kuiwang/teiid-index:1889721 -c docker --mode=semver-skippatch
INFO[0000] building the index                            bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0000] Pulling previous image quay.io/kuiwang/teiid-index:1889721 to get metadata  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0000] running /usr/bin/docker pull quay.io/kuiwang/teiid-index:1889721  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] Getting label data from previous image        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker inspect                        bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0001] running /usr/bin/docker pull quay.io/kuiwang/teiid-operator:v0.2.0-2  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker create                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker cp                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker rm                             bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] Could not find optional dependencies file     dir=bundle_tmp816563113 file=bundle_tmp816563113/metadata load=annotations
INFO[0002] found csv, loading bundle                     dir=bundle_tmp816563113 file=bundle_tmp816563113/manifests load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp816563113/manifests file=teiid.io_virtualdatabases_crd.yaml load=bundle
INFO[0002] loading bundle file                           dir=bundle_tmp816563113/manifests file=teiid.v0.4.0.clusterserviceversion.yaml load=bundle
INFO[0002] Generating dockerfile                         bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] writing dockerfile: index.Dockerfile387263519  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] running docker build                          bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
INFO[0002] [docker build -f index.Dockerfile387263519 -t quay.io/kuiwang/teiid-index:1889721 .]  bundles="[quay.io/kuiwang/teiid-operator:v0.2.0-2]"
[root@preserve-olm-env operator-registry]# docker push quay.io/kuiwang/teiid-index:1889721
The push refers to repository [quay.io/kuiwang/teiid-index]
669d7c1f938f: Pushed
14d454bac30e: Layer already exists
7a12ba9c099a: Layer already exists
371d4702865c: Layer already exists
4570b0d18853: Layer already exists
ace0eda3e3be: Layer already exists
1889721: digest: sha256:cac4faa02d3d53e91ab4ff16359fc6863c31d0f525fe28c79d9f20da5b143b2f size: 1578
[root@preserve-olm-env operator-registry]#
 
[root@preserve-olm-env operator-registry]# docker create quay.io/kuiwang/teiid-index:1889721
f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9
[root@preserve-olm-env operator-registry]# rm -fr index.db
[root@preserve-olm-env operator-registry]# docker cp f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9:/database/index.db .
[root@preserve-olm-env operator-registry]# docker rm f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9
f96bd1ba9ac0f49f7c1bd49f98f83d12e8d502e86d07d585833c1349d24153a9
[root@preserve-olm-env operator-registry]# 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> SELECT name, version, replaces FROM operatorbundle;
name          version     replaces  
------------  ----------  ----------
teiid.v0.2.0  0.2.0                
teiid.v0.3.0  0.2.0-1     teiid.v0.2
teiid.v0.4.0  0.2.0-2     teiid.v0.3
sqlite> select name, replaces from operatorbundle;
name          replaces  
------------  ----------
teiid.v0.2.0            
teiid.v0.3.0  teiid.v0.2
teiid.v0.4.0  teiid.v0.3
sqlite> select entry_id, replaces, operatorbundle_name from channel_entry;
entry_id    replaces    operatorbundle_name
----------  ----------  -------------------
1           2           teiid.v0.2.0      
2                       teiid.v0.4.0      
3                       teiid.v0.3.0      
4           3           teiid.v0.4.0      
sqlite> .exit
[root@preserve-olm-env operator-registry]#

[root@preserve-olm-env 1889721]# oc get pod -n openshift-operator-lifecycle-manager
NAME                                READY   STATUS    RESTARTS   AGE
catalog-operator-666d76887f-vnzvx   1/1     Running   0          5h45m
olm-operator-668995fc69-p89zg       1/1     Running   0          5h42m
packageserver-d6484d855-b58r4       1/1     Running   0          5h42m
packageserver-d6484d855-lng7r       1/1     Running   0          5h45m
[root@preserve-olm-env 1889721]# oc exec catalog-operator-666d76887f-vnzvx -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.17.0
git commit: 7988750a76c02530a72e77fff67705d4b2c0a9c9


[root@preserve-olm-env 1889721]# cat og-single.yaml
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single1
  namespace: default
spec:
  targetNamespaces:
  - default
[root@preserve-olm-env 1889721]# oc apply -f og-single.yaml
operatorgroup.operators.coreos.com/og-single1 created
[root@preserve-olm-env 1889721]# cat catsrcteiid.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: olm-1933-v1-catalog
  namespace: default
spec:
  displayName: OLM 1933 Operator Catalog
  image: quay.io/kuiwang/teiid-index:1889721
  icon:
    base64data: ""
    mediatype: ""
  publisher: QE
  sourceType: grpc
  updateStrategy:
    registryPoll:
      interval: 2m0s
[root@preserve-olm-env 1889721]# oc apply -f catsrcteiid.yaml
catalogsource.operators.coreos.com/olm-1933-v1-catalog created
[root@preserve-olm-env 1889721]# oc get pod
NAME                        READY   STATUS    RESTARTS   AGE
olm-1933-v1-catalog-jm94n   0/1     Running   0          7s
[root@preserve-olm-env 1889721]# oc get pod
NAME                        READY   STATUS    RESTARTS   AGE
olm-1933-v1-catalog-jm94n   0/1     Running   0          13s
[root@preserve-olm-env 1889721]# oc get pod
NAME                        READY   STATUS    RESTARTS   AGE
olm-1933-v1-catalog-jm94n   1/1     Running   0          21s
[root@preserve-olm-env 1889721]# cat sub-t.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: teiid
  namespace: default
spec:
  channel: beta
  installPlanApproval: Automatic
  name: teiid
  source: olm-1933-v1-catalog
  sourceNamespace: default
  startingCSV: teiid.v0.2.0
[root@preserve-olm-env 1889721]# oc apply -f sub-t.yaml
subscription.operators.coreos.com/teiid created
[root@preserve-olm-env 1889721]# oc get sub
NAME    PACKAGE   SOURCE                CHANNEL
teiid   teiid     olm-1933-v1-catalog   beta
[root@preserve-olm-env 1889721]# oc get ip
NAME            CSV            APPROVAL    APPROVED
install-49z9t   teiid.v0.2.0   Automatic   true
[root@preserve-olm-env 1889721]# oc get csv
No resources found in default namespace.
[root@preserve-olm-env 1889721]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.2.0   Teiid     0.2.0                Installing
[root@preserve-olm-env 1889721]# oc get csv
NAME           DISPLAY   VERSION   REPLACES   PHASE
teiid.v0.2.0   Teiid     0.2.0                Succeeded
--


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