Description of problem: Oc-mirror write dup metadata to registry backend Version-Release number of selected component (if applicable): oc-mirror version Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202206030929.p0.gb22233e.assembly.stream-b22233e", GitCommit:"b22233e611ab4692748ffc992a235abd9c231ecf", GitTreeState:"clean", BuildDate:"2022-06-03T10:12:00Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"} How reproducible: Always Steps to Reproduce: Use registry backend to store the metadata as following: cat settingconfig.yaml apiVersion: mirror.openshift.io/v1alpha2 kind: ImageSetConfiguration storageConfig: registry: imageURL: localhost:5000/detest skipTLS: false mirror: operators: - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.10 packages: - name: sriov-network-operator channels: - name: stable Use oc-mirror to do the mirror2mirror : `oc-mirror --config settingconfig.yaml docker://localhost:5000 --dest-use-http --continue-on-error -v 9` Actual results 2. Will write dup metadata to registry : Using registry backend at location localhost:5000/detest Checking for existing metadata image at localhost:5000/detest:latest looking for metadata file at "publish/.metadata.json" Resolving operator metadata … Resolving OCP release metadata Pushing metadata to registry at localhost:5000/detest:latest Checking for existing metadata image at localhost:5000/detest:latest looking for metadata file at "publish/.metadata.json" Pushing metadata to registry at localhost:5000/oc-mirror:950699c0-cf8a-46d9-a427-92d153b38131 Check the registry dir : tree detest/ detest/ ├── _layers │ └── sha256 │ ├── 3376df5fbe4092cffb084e42f76f57b746c7a162ba4425ed70f74013d5644e29 │ │ └── link │ └── 9c51186ed5d34d8bc8dc5b686a97c0515da973f7c6b3f52da8f11f8243181d03 │ └── link ├── _manifests │ ├── revisions │ │ └── sha256 │ │ └── d91535ca1110a6230e802c315e6b85e2c592c52af7921af062f235a4191dd796 │ │ └── link │ └── tags │ └── latest │ ├── current │ │ └── link │ └── index │ └── sha256 │ └── d91535ca1110a6230e802c315e6b85e2c592c52af7921af062f235a4191dd796 │ └── link └── _uploads 15 directories, 5 files [root@localhost repositories]# tree oc-mirror/ oc-mirror/ ├── _layers │ └── sha256 │ ├── 3376df5fbe4092cffb084e42f76f57b746c7a162ba4425ed70f74013d5644e29 │ │ └── link │ └── 9c51186ed5d34d8bc8dc5b686a97c0515da973f7c6b3f52da8f11f8243181d03 │ └── link ├── _manifests │ ├── revisions │ │ └── sha256 │ │ └── d91535ca1110a6230e802c315e6b85e2c592c52af7921af062f235a4191dd796 │ │ └── link │ └── tags │ └── 1e29f322-2082-4705-9aec-e3c47bc655fc │ ├── current │ │ └── link │ └── index │ └── sha256 │ └── d91535ca1110a6230e802c315e6b85e2c592c52af7921af062f235a4191dd796 │ └── link └── _uploads └── 950699c0-cf8a-46d9-a427-92d153b38131 └── hashstates └── sha256 └── 0 18 directories, 6 files Expected result: 2. Only one metadata is enough Additional info:
@yinzhou This is actually part of the design. When using mirror-to-mirror mode the metadata is always stored where specified by the user, in this case, "localhost:5000/detest" and in an expected location managed by oc-mirror (always "registry/namespace/oc-mirror:UUID). This allows the user to seamlessly switch between a fully-disconnected workflow and a partially disconnected workflow.
Jennifer Power: Got you , thanks , will move to verified status.
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