Created attachment 1896458 [details] original config Created attachment 1896458 [details] original config Description of problem: When using an imageset-config.yaml that has an OpenShift release, a few Red Hat operators, and a Community operator, it fails to upload to the disconnected registry. Version-Release number of selected component (if applicable): $ podman exec -it oc-mirror oc-mirror version Client Version: version.Info{Major:"", Minor:"", GitVersion:"v0.2.0-alpha.1-55-gf4d5f4b", GitCommit:"f4d5f4b5", GitTreeState:"dirty", BuildDate:"2022-06-17T22:07:53Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"} How reproducible: Steps to Reproduce: 1. Populate registry initially using OpenShift release, and a few Red Hat operators oc-mirror --config imageset-config.yaml.orig file://archives oc-mirror --from archives docker://<registry>) 2. Update imageset-config.yaml to add Grafana Community operator add grafana-community operator to images-config.yaml.orig 3. Pull updates oc-mirror --config imageset-config.yaml file://archives 4. Push of update fails oc-mirror --from archives docker://<registry> Actual results: info: Mirroring completed in 340ms (143.7kB/s) Wrote release signatures to oc-mirror-workspace/results-1657636245 Rendering catalog image "registry-quay-quay.apps.ocp4.example.com/redhat/community-operator-index:v4.10" with file-based catalog Rendering catalog image "registry-quay-quay.apps.ocp4.example.com/redhat/redhat-operator-index:v4.10" with file-based catalog error: error rebuilding catalog images from file-based catalogs: error creating OCI layout: stat oc-mirror-workspace/images.1969864861/catalogs/registry.redhat.io/redhat/redhat-operator-index/v4.10/layout/index.json: no such file or directory Expected results: syncing finishes and generates catalog image, imagecontentsourcepolicy, etc. Additional info:
For a bit more background. This bug has to do with how directories are unpacked when multiple imageset spans multiple archives. In this case, the 'archiveSize' is smaller than the combined size of the OCI layouts for these two catalogs. A possible solution is to update the structure returned from this function (https://github.com/openshift/oc-mirror/blob/c1cd75916009557cbb4c02402f0b0c14edb6de7b/pkg/bundle/files.go#L96) to allow multiple key values so the archive containing the directories is not overwritten.
Correction on the previous comment. Please disregard the proposed solution. The directory itself is only stored in one archive.