Bug 2093957 - Oc-mirror write dup metadata to registry backend
Summary: Oc-mirror write dup metadata to registry backend
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.11
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: Alex
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-06-06 12:58 UTC by zhou ying
Modified: 2022-08-10 11:16 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:16:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 485 0 None open bug 2093957: [docs] Light readme maint 2022-06-22 22:14:42 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:16:36 UTC

Description zhou ying 2022-06-06 12:58:04 UTC
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:

Comment 1 Jennifer Power 2022-06-06 14:27:36 UTC
@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.

Comment 3 zhou ying 2022-06-24 03:49:13 UTC
Jennifer Power:

Got you , thanks , will move to verified status.

Comment 5 errata-xmlrpc 2022-08-10 11:16:21 UTC
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


Note You need to log in before you can comment on or make changes to this bug.