Bug 1883377
Summary: | opm registry add fails with FOREIGN KEY constraint when bundle default channel is empty | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | Jesus M. Rodriguez <jesusr> |
Component: | OLM | Assignee: | Vu Dinh <vdinh> |
OLM sub component: | OLM | QA Contact: | Bruno Andrade <bandrade> |
Status: | CLOSED ERRATA | Docs Contact: | |
Severity: | high | ||
Priority: | high | CC: | bandrade, bluddy, krizza |
Version: | 4.6 | ||
Target Milestone: | --- | ||
Target Release: | 4.6.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-10-27 16:45:59 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Jesus M. Rodriguez
2020-09-29 00:53:13 UTC
This will block: operator-sdk run bundle or anyone with a bundle and a blank default channel. Hey Jesus, It seems you are adding the first bundle for a new package without default channel. Can you confirm that? The default channel is required when a new package is created (via the first bundle addition). So the first bundle needs to have default channel information. Then, subsequent bundles may not have default channel if there is no change in default channel setting. I tried to add bundles in semver mode using proper order (first bundle with default channel and second one without) and it worked just fine. So this is not a bug. What I can improve here is to handle the error a bit better so it won't go too far down to the DB transaction level and add a default channel inference that is similar in replace mode (if you have only one channel in channel list then we will pick the that channel as default if you add the first bundle in the package). Vu It is the first bundle and likely the only bundle. One of our use cases is to run a bundle without specifying an index image. We use the builder to create an ephemeral index. based on a lengthy slack discussion: the best thing to do here is, in this case, if the field isn't set just pick it lexicographically like what Vu described in comment #2. Marking as VERIFIED. $ bin/opm version Version: version.Version{OpmVersion:"v1.14.3-5-gf6e5d92", GitCommit:"f6e5d92", BuildDate:"2020-10-02T11:29:08Z", GoOs:"linux", GoArch:"amd6 $ bin/opm registry add -d index.db -b quay.io/vnarsing/memcached-operator:v1 --mode=semver -c podman INFO[0000] adding to the registry bundles="[quay.io/vnarsing/memcached-operator:v1]" INFO[0000] running /usr/bin/podman pull quay.io/vnarsing/memcached-operator:v1 bundles="[quay.io/vnarsing/memcached-operator:v1]" INFO[0005] running podman create bundles="[quay.io/vnarsing/memcached-operator:v1]" INFO[0005] running podman cp bundles="[quay.io/vnarsing/memcached-operator:v1]" INFO[0005] running podman rm bundles="[quay.io/vnarsing/memcached-operator:v1]" INFO[0005] Could not find optional dependencies file dir=bundle_tmp214709305 file=bundle_tmp214709305/metadata load=annotations INFO[0005] found csv, loading bundle dir=bundle_tmp214709305 file=bundle_tmp214709305/manifests load=bundle INFO[0005] loading bundle file dir=bundle_tmp214709305/manifests file=barlyvt.example.comlyvt_foolyvts.yaml load=bundle INFO[0005] loading bundle file dir=bundle_tmp214709305/manifests file=e2e-lyvt-metrics-reader_rbac.authorization.k8s.io_v1beta1_clusterrole.yaml load=bundle INFO[0005] loading bundle file dir=bundle_tmp214709305/manifests file=e2e-lyvt.clusterserviceversion.yaml load=bundle Inference worked successfully. 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 (OpenShift Container Platform 4.6 GA Images), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:4196 |