Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-8111

Limit the nested repository path while mirroring the images using oc-mirror for those who cant have nested paths in their container registry

XMLWordPrintable

    • No
    • CFE Sprint 234
    • 1
    • Proposed
    • False
    • Hide

      None

      Show
      None
    • Hide
      Previously, you were receiving `401 - Unauthorized` error for registries where the number of path components exceeded the expected maximum path components. This issue is fixed by ensuring that the oc-mirror fails when the number of path components exceeds maximum path components. You can now set the maximum path components by using the flag `--max-nested-paths`, which accepts an integer value. By default, there is no limit to the maximum path components and is set to `0`. The generated `ImageContentSourcePolicy` will contain source and mirror references up to the repository level.
      (link:https://issues.redhat.com/browse/OCPBUGS-8111[OCPBUGS-8111]) (link:https://issues.redhat.com/browse/OCPBUGS-11910[OCPBUGS-11910]) (link:https://issues.redhat.com/browse/OCPBUGS-11922[OCPBUGS-11922])
      Show
      Previously, you were receiving `401 - Unauthorized` error for registries where the number of path components exceeded the expected maximum path components. This issue is fixed by ensuring that the oc-mirror fails when the number of path components exceeds maximum path components. You can now set the maximum path components by using the flag `--max-nested-paths`, which accepts an integer value. By default, there is no limit to the maximum path components and is set to `0`. The generated `ImageContentSourcePolicy` will contain source and mirror references up to the repository level. (link: https://issues.redhat.com/browse/OCPBUGS-8111 [ OCPBUGS-8111 ]) (link: https://issues.redhat.com/browse/OCPBUGS-11910 [OCPBUGS-11910]) (link: https://issues.redhat.com/browse/OCPBUGS-11922 [ OCPBUGS-11922 ])
    • Bug Fix
    • Done

      Description of problem:

      Customer was able to limit the nested repository path with "oc adm catalog mirror" by using the argument "--max-components" but there is no alternate solution along with "oc-mirror" binary while we are suggesting to use "oc-mirror" binary for mirroring.for example:
      Mirroring will work if we mirror like below
      oc mirror --config=./imageset-config.yaml docker://registry.gitlab.com/xxx/yyy
      Mirroring will fail with 401 unauthorized if we add one more nested path like below
      oc mirror --config=./imageset-config.yaml docker://registry.gitlab.com/xxx/yyy/zzz

      Version-Release number of selected component (if applicable):

       

      How reproducible:

      We can reproduce the issue by using a repository which is not supported deep nested paths

      Steps to Reproduce:

      1. Create a imageset to mirror any operator
      
      kind: ImageSetConfiguration
      apiVersion: mirror.openshift.io/v1alpha2
      storageConfig:
        local:
          path: ./oc-mirror-metadata
      mirror:
        operators:
        - catalog: registry.redhat.io/redhat/redhat-operator-index:v4.12
          packages:
          - name: local-storage-operator
            channels:
            - name: stable
      
      2. Do the mirroring to a registry where its not supported deep nested repository path, Here its gitlab and its doesnt not support netsting beyond 3 levels deep.
      
      oc mirror --config=./imageset-config.yaml docker://registry.gitlab.com/xxx/yyy/zzz
      
      this mirroring will fail with 401 unauthorized error
       
      3. if  try to mirror the same imageset by removing one path it will work without any issues, like below
      
      oc mirror --config=./imageset-config.yaml docker://registry.gitlab.com/xxx/yyy 

      Actual results:

       

      Expected results:

      Need a alternative option of "--max-components" to limit the nested path in "oc-mirror"

      Additional info:

       

              luzuccar@redhat.com Luigi Mario Zuccarelli
              rhn-support-amuhamme MUHAMMED ASLAM V K
              ying zhou ying zhou
              Votes:
              1 Vote for this issue
              Watchers:
              14 Start watching this issue

                Created:
                Updated:
                Resolved: