-
Bug
-
Resolution: Unresolved
-
Normal
-
4.16, 4.17, 4.18, 4.19, 4.20, 4.21
-
Quality / Stability / Reliability
-
False
-
-
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`