-
Bug
-
Resolution: Done-Errata
-
Major
-
None
-
4.15
This is a clone of issue OCPBUGS-31466. The following is the description of the original issue:
—
Description of problem:
It seems something might be wrong with the logic for the new defaultChannel property. After initially syncing an operator to a tarball, subsequent runs complain the catalog is invalid, as if defaultChannel was never set.
Version-Release number of selected component (if applicable):
I tried oc-mirror v4.14.16 and v4.15.2
How reproducible:
100%
Steps to Reproduce:
1. Write this yaml config to an isc.yaml file in an empty dir. (It is worth noting that right now the default channel for this operator is of course something else – currently `latest`.)
kind: ImageSetConfiguration apiVersion: mirror.openshift.io/v1alpha2 storageConfig: local: path: ./operator-images mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.14 packages: - name: openshift-pipelines-operator-rh defaultChannel: pipelines-1.11 channels: - name: pipelines-1.11 minVersion: 1.11.3 maxVersion: 1.11.3
2. Using oc-mirror v4.14.16 or v4.15.2, run:
oc-mirror -c ./isc.yaml file://operator-images
3. Without the defaultChannel property and a recent version of oc-mirror, that would have failed. Assuming it succeeds, run the same command a second time (with or without the --dry-run option) and note that it now fails. It seems nothing can be done. oc-mirror says the catalog is invalid.
Actual results:
$ oc-mirror -c ./isc.yaml file://operator-images Creating directory: operator-images/oc-mirror-workspace/src/publish Creating directory: operator-images/oc-mirror-workspace/src/v2 Creating directory: operator-images/oc-mirror-workspace/src/charts Creating directory: operator-images/oc-mirror-workspace/src/release-signatures No metadata detected, creating new workspace wrote mirroring manifests to operator-images/oc-mirror-workspace/operators.1711523827/manifests-redhat-operator-indexTo upload local images to a registry, run: oc adm catalog mirror file://redhat/redhat-operator-index:v4.14 REGISTRY/REPOSITORY <dir> openshift-pipelines/pipelines-chains-controller-rhel8 blobs: registry.redhat.io/openshift-pipelines/pipelines-chains-controller-rhel8 sha256:b06cce9e748bd5e1687a8d2fb11e5e01dd8b901eeeaa1bece327305ccbd62907 11.51KiB registry.redhat.io/openshift-pipelines/pipelines-chains-controller-rhel8 sha256:e5897b8264878f1f63f6eceed870b939ff39993b05240ce8292f489e68c9bd19 11.52KiB ... stats: shared=12 unique=274 size=24.71GiB ratio=0.98 info: Mirroring completed in 9m45.86s (45.28MB/s) Creating archive operator-images/mirror_seq1_000000.tar $ oc-mirror -c ./isc.yaml file://operator-images Found: operator-images/oc-mirror-workspace/src/publish Found: operator-images/oc-mirror-workspace/src/v2 Found: operator-images/oc-mirror-workspace/src/charts Found: operator-images/oc-mirror-workspace/src/release-signatures The current default channel was not valid, so an attempt was made to automatically assign a new default channel, which has failed. The failure occurred because none of the remaining channels contain an "olm.channel" priority property, so it was not possible to establish a channel to use as the default channel. This can be resolved by one of the following changes: 1) assign an "olm.channel" property on the appropriate channels to establish a channel priority 2) modify the default channel manually in the catalog 3) by changing the ImageSetConfiguration to filter channels or packages in such a way that it will include a package version that exists in the current default channel The rendered catalog is invalid. Run "oc-mirror list operators --catalog CATALOG-NAME --package PACKAGE-NAME" for more information. error: error generating diff: the current default channel "latest" for package "openshift-pipelines-operator-rh" could not be determined... ensure that your ImageSetConfiguration filtering criteria results in a package version that exists in the current default channel or use the 'defaultChannel' field
Expected results:
It should NOT throw that error and instead should either update (if you've added more to the imagesetconfig) or gracefully print the "No new images" message.
- clones
-
OCPBUGS-31466 oc-mirror's new defaultChannel property breaks after initial sync
- Closed
- is blocked by
-
OCPBUGS-31466 oc-mirror's new defaultChannel property breaks after initial sync
- Closed
- links to
-
RHBA-2024:2773 OpenShift Container Platform 4.15.z bug fix update