core/remotes: Handle attestations in MakeRefKey

Don't produce `reference for unknown type: application/vnd.in-toto+json`
warning logs when pushing/fetching an image containing the attestation
manifests.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
Paweł Gronowski 2025-01-31 16:39:43 +01:00 committed by k8s-infra-cherrypick-robot
parent df4d905a6f
commit 916d487226

View File

@ -80,6 +80,8 @@ func MakeRefKey(ctx context.Context, desc ocispec.Descriptor) string {
return "layer-" + key
case images.IsKnownConfig(desc.MediaType):
return "config-" + key
case images.IsAttestationType(desc.MediaType):
return "attestation-" + key
default:
log.G(ctx).Warnf("reference for unknown type: %s", desc.MediaType)
return "unknown-" + key