Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1921778

Summary: Push to stage now failing with semver issues on old releases
Product: OpenShift Container Platform Reporter: kconner
Component: OLMAssignee: Kevin Rizza <krizza>
OLM sub component: OLM QA Contact: Bruno Andrade <bandrade>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: afield, fbrychta, gbaufake, krizza, nhale, tmoreira
Version: 4.7   
Target Milestone: ---   
Target Release: 4.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-27 22:37:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 4 Jian Zhang 2021-02-09 04:28:12 UTC
> This yields  `v1.0.0-1.2.3 < v1.0.0-1.1.55` which is then mapped back to `v1.2.3+1.2.3 < v.1.2.3+1.1.55`

Does it follow the typical semver precedence rules? If yes, I guess it should be `v1.0.0-1.1.55 < v1.0.0-1.2.3`, right?

Sorry, I couldn't reproduce this issue with an old opm. For example, am I missing something? Or what's the difference between opm and the build command in http://pub.devel.redhat.com/pub/task/340215/log/stdout.log?
 
[root@preserve-olm-env data]# opm index add -b registry.stage.redhat.io/openshift-istio/kiali-operator-metadata:2.3-1 -f registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.7 -t registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.7-bug --overwrite-latest
INFO[0000] building the index                            bundles="[registry.stage.redhat.io/openshift-istio/kiali-operator-metadata:2.3-1]"
INFO[0000] Pulling previous image registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.7 to get metadata  bundles="[registry.stage.redhat.io/openshift-istio/kiali-operator-metadata:2.3-1]"
INFO[0000] resolved name: registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.7  bundles="[registry.stage.redhat.io/openshift-is
...
...
INFO[0020] [podman build --format docker -f index.Dockerfile879176593 -t registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.7-bug .]  bundles="[registry.stage.redhat.io/openshift-istio/kiali-operator-metadata:2.3-1]"

[root@preserve-olm-env data]# opm version
Version: version.Version{OpmVersion:"v1.14.3-94-g6183dbb", GitCommit:"6183dbb", BuildDate:"2021-02-04T09:33:47Z", GoOs:"linux", GoArch:"amd64"}

It works well too with the olm opm:
- `registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.5`
- `registry-proxy.engineering.redhat.com/rh-osbs/iib-pub-pending:v4.6` 

registry.stage.redhat.io/openshift-service-mesh/istio-rhel8-operator-metadata:2.0.1.1-6

Comment 5 Kevin Rizza 2021-02-11 14:09:04 UTC
Hi Jian,

So the problem that we ran into here is that there is one operator in the stage index that was using buildId as part of its versioning. So it was explicitly *not* using semantic versioning. This generally isn't a problem in replaces mode except in the case where bundles are batch added as a set into an index all at once (which happens either when you pass several bundles into an index add command or whenever using --overwrite-latest). So, this edge case is specifically when buildId is set on two bundles in a given channel and the version is otherwise identical.

more detail here: https://github.com/operator-framework/operator-registry/pull/571#issue-563493254

Basically, the fix here is that we now consider buildId when attempting to internally decide what order to insert a set of bundles when more than one is passed in.

Comment 9 errata-xmlrpc 2021-07-27 22:37:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.8.2 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2021:2438