Bug 2039135
| Summary: | the error message is not clear when using "opm index prune" to prune a file-based index image | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | xzha |
| Component: | OLM | Assignee: | Per da Silva <pegoncal> |
| OLM sub component: | OLM | QA Contact: | xzha |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | jiazha, pegoncal, rugouvei, tyslaton |
| Version: | 4.10 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.11.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause: Unhelpful error message when running OPM index prune against a File-Based Catalog image
Consequence: User confusion
Fix: Improved the error message to make clear to the user that OPM index prune is only valid for SQLite-based images
Result: User understands that this command is not for File-Based Catalog images
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-08-10 10:41:42 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: | |||
verify:
zhaoxia@xzha-mac operator-framework-olm % ./bin/opm version
Version: version.Version{OpmVersion:"5bbcf1030", GitCommit:"5bbcf1030d00435022e8300cab1fbada4edf0096", BuildDate:"2022-05-19T07:08:59Z", GoOs:"darwin", GoArch:"amd64"}
zhaoxia@xzha-mac operator-framework-olm % ./bin/opm index prune -p etcd --from-index quay.io/olmqe/etcd-index:47322-single -c docker
WARN[0000] DEPRECATION NOTICE:
Sqlite-based catalogs and their related subcommands are deprecated. Support for
them will be removed in a future release. Please migrate your catalog workflows
to the new file-based catalog format.
INFO[0000] pruning the index packages="[etcd]"
INFO[0000] Pulling previous image quay.io/olmqe/etcd-index:47322-single to get metadata packages="[etcd]"
INFO[0000] running /usr/local/bin/docker pull quay.io/olmqe/etcd-index:47322-single packages="[etcd]"
INFO[0004] running /usr/local/bin/docker pull quay.io/olmqe/etcd-index:47322-single packages="[etcd]"
INFO[0008] Getting label data from previous image packages="[etcd]"
INFO[0008] running docker inspect packages="[etcd]"
Error: `opm index prune` only supports sqlite-based catalogs
Usage:
opm index prune [flags]
Flags:
-i, --binary-image opm container image for on-image opm command
-c, --container-tool string tool to interact with container images (save, build, etc.). One of: [docker, podman] (default "podman")
-f, --from-index string index to prune
--generate if enabled, just creates the dockerfile and saves it to local disk
-h, --help help for prune
-d, --out-dockerfile string if generating the dockerfile, this flag is used to (optionally) specify a dockerfile name
-p, --packages strings comma separated list of packages to keep
--permissive allow registry load errors
-t, --tag string custom tag for container image being built
Global Flags:
--skip-tls-verify skip TLS certificate verification for container image registries while pulling bundles
--use-http use plain HTTP for container image registries while pulling bundles
LGTM, verified
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.11.0 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-2022:5069 |
Description of problem: the error message "opm index prune" a file-based index image is not clear, the message "Error: index image xxxx missing label operators.operatorframework.io.index.database.v1" is confusing. Version-Release number of selected component (if applicable): [root@preserve-olm-agent-test ~]# opm version Version: version.Version{OpmVersion:"13f7723ba", GitCommit:"13f7723ba6098a17c7c44da17d844bb0d87d30a7", BuildDate:"2021-12-29T01:32:43Z", GoOs:"linux", GoArch:"amd64"} How reproducible: always Steps to Reproduce: [root@preserve-olm-agent-test ~]# opm alpha list packages quay.io/olmqe/etcd-index:47322-single NAME DISPLAY NAME DEFAULT CHANNEL ditto-operator Eclipse Ditto v2.0 etcd etcd alpha-1 1.opm index prune -p etcd --from-index quay.io/olmqe/etcd-index:47322-single WARN[0000] DEPRECATION NOTICE: Sqlite-based catalogs and their related subcommands are deprecated. Support for them will be removed in a future release. Please migrate your catalog workflows to the new file-based catalog format. INFO[0000] pruning the index packages="[etcd]" INFO[0000] Pulling previous image quay.io/olmqe/etcd-index:47322-single to get metadata packages="[etcd]" INFO[0000] running /usr/bin/podman pull quay.io/olmqe/etcd-index:47322-single packages="[etcd]" INFO[0001] running /usr/bin/podman pull quay.io/olmqe/etcd-index:47322-single packages="[etcd]" INFO[0002] Getting label data from previous image packages="[etcd]" INFO[0002] running podman inspect packages="[etcd]" Error: index image quay.io/olmqe/etcd-index:47322-single missing label operators.operatorframework.io.index.database.v1 Usage: opm index prune [flags] Flags: -i, --binary-image opm container image for on-image opm command -c, --container-tool string tool to interact with container images (save, build, etc.). One of: [docker, podman] (default "podman") -f, --from-index string index to prune --generate if enabled, just creates the dockerfile and saves it to local disk -h, --help help for prune -d, --out-dockerfile string if generating the dockerfile, this flag is used to (optionally) specify a dockerfile name -p, --packages strings comma separated list of packages to keep --permissive allow registry load errors -t, --tag string custom tag for container image being built Global Flags: --skip-tls skip TLS certificate verification for container image registries while pulling bundles or index 2. 3. Actual results: the error message is not clear. "Error: index image quay.io/olmqe/etcd-index:47322-single missing label operators.operatorframework.io.index.database.v1" Expected results: the error message should be more clear, for example "opm index prune doesn’t support file-based catalog" or "opm index prune only support sqlite-based catalog" Additional info: