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

Add note regarding change in behavior between oc-mirror v1 and v2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • 4.21
    • 4.16, 4.17, 4.18, 4.19, 4.20, 4.21
    • Documentation
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • 3
    • Moderate
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When migrating from oc-mirror v1 to v2, images listed under additionalImages without an explicit registry hostname are mirrored to incorrect target paths.
      
      In oc-mirror v1, image parsing relied on OpenShift’s library-go, which automatically defaulted missing registries to docker.io, preserving consistent namespace structure. 
      - Ref: https://github.com/openshift/oc-mirror/blob/main/pkg/image/resolve.go 
      
      In oc-mirror v2, parsing now uses the upstream go-containerregistry library, which follows stricter OCI standards — it no longer defaults to docker.io and instead treats the first path component as a potential registry, leading to different mirroring behavior for images without explicit hostnames.

      Example:
      In oc-mirror v2

      - https://github.com/openshift/oc-mirror/blob/main/v2/internal/pkg/image/image.go#L51 
      
      The above function returns:
      
      1] additinalImages:
          - docker.io/netapp/trident-autosupport:25.02
      
      --> imgSpec.Domain = "docker.io"
          imgSpec.PathComponent = "netapp/trident-autosupport"  <---
      
      2] additionalImages:
          - netapp/trident-autosupport:25.02 
      
      --> imgSpec.Domain = "netapp"
          imgSpec.PathComponent = "trident-autosupport" <---
      

      However, in oc-mirror v1, both inputs normalize to the same canonical image reference (docker.io/netapp/trident-autosupport:25.02)

      {{Action needed: }}
      Raising this bug to add an note in the documentation of oc-mirror v2 about strictly following the suggested format while mirroring `additionalImages`

       

       

       

              sdudhgao@redhat.com Servesha Dudhgaonkar
              rhn-support-harspati Harshada Patil
              None
              None
              Nidan Gavali Nidan Gavali
              None
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: