You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When transferring component versions with --copy-resources, the ociArtifact transformer and the blob transformers build different credential consumer identities for the same OCI registry.
Blob transformers use IdentityFromOCIRepository which parses the repository BaseUrl (e.g. oci://ghcr.io) and defaultsport=443 and scheme=oci.
OCI artifact transformer uses ResourceRepository.getIdentity → ParseURLToIdentity which parses the image reference (e.g. ghcr.io/repo/image:tag) and produces an identity withoutscheme or port since they are not present in the reference string.
A single credential entry in ocmconfig.yaml cannot satisfy both code paths — one expects hostname=ghcr.io,port=443,scheme=oci,type=OCIRepository, the other expects hostname=ghcr.io,type=OCIRepository.
The root issue is that IdentityFromOCIRepository assumes defaults for scheme and port. The credential matcher then requires an exact match on all identity attributes. Instead, identities should only contain attributes that are explicitly known, and the matcher should support partial matching — a lookup identity with fewer attributes should match credential entries with more attributes.
Version
Latest main branch + PR #1684 (feat: oci artifact cli).
To Reproduce
Create a component version with an ociArtifact resource:
ocm transfer component-version --recursive --copy-resources \
ctf::source.ctf//my-org/my-component:v1.0.0 \
oci::oci://ghcr.io/my-org/target
Actual behavior
Blob transformers succeed (identity matches hostname=ghcr.io,port=443,scheme=oci,type=OCIRepository), but the GetOCIArtifact transformer fails with:
failed to resolve credentials for identity "hostname=ghcr.io,type=OCIRepository": credentials not found
The OCI artifact transformer produces an identity with only hostname and type (no port, no scheme), so the credential matcher does not find a match.
Expected behavior
A single credential entry for ghcr.io should work for all transformers accessing the same registry. The fix should focus on two things:
Identity should not assume defaults — IdentityFromOCIRepository should stop defaulting scheme and port when they are not explicitly present in the URL. Identities should only contain attributes that are explicitly known.
Matcher should support partial matching — a lookup identity with fewer attributes (e.g. just hostname + type) should match credential entries that have additional attributes (e.g. hostname + type + port + scheme). Additional Comments~ (moved to: Fix credential consumer identity issues ocm-project#916)
Context
When transferring component versions with
--copy-resources, the ociArtifact transformer and the blob transformers build different credential consumer identities for the same OCI registry.BaseUrl(e.g.oci://ghcr.io) and defaultsport=443andscheme=oci.ghcr.io/repo/image:tag) and produces an identity withoutschemeorportsince they are not present in the reference string.A single credential entry in ocmconfig.yaml cannot satisfy both code paths — one expects
hostname=ghcr.io,port=443,scheme=oci,type=OCIRepository, the other expectshostname=ghcr.io,type=OCIRepository.The root issue is that IdentityFromOCIRepository assumes defaults for
schemeandport. The credential matcher then requires an exact match on all identity attributes. Instead, identities should only contain attributes that are explicitly known, and the matcher should support partial matching — a lookup identity with fewer attributes should match credential entries with more attributes.Version
Latest
mainbranch + PR #1684 (feat: oci artifact cli).To Reproduce
Create a component version with an
ociArtifactresource:Configure ocmconfig.yaml with a single credential entry:
Run:
Actual behavior
Blob transformers succeed (identity matches
hostname=ghcr.io,port=443,scheme=oci,type=OCIRepository), but theGetOCIArtifacttransformer fails with:The OCI artifact transformer produces an identity with only
hostnameandtype(noport, noscheme), so the credential matcher does not find a match.Expected behavior
A single credential entry for
ghcr.ioshould work for all transformers accessing the same registry. The fix should focus on two things:schemeandportwhen they are not explicitly present in the URL. Identities should only contain attributes that are explicitly known.Matcher should support partial matching — a lookup identity with fewer attributes (e.g. justhostname+type) should match credential entries that have additional attributes (e.g.hostname+type+port+scheme).Additional Comments~ (moved to: Fix credential consumer identity issues ocm-project#916)
Relevant code paths:
portandschemeRelated: PR #1684