MCPcopy Create free account
hub / github.com/conforma/cli / getDigestRefForImage

Function getDigestRefForImage

acceptance/image/image.go:365–374  ·  view source on GitHub ↗

getDigestRefForImage returns the digest reference for an image in the stub registry

(ctx context.Context, imageName string, digest v1.Hash)

Source from the content-addressed store, hash-verified

363
364// getDigestRefForImage returns the digest reference for an image in the stub registry
365func getDigestRefForImage(ctx context.Context, imageName string, digest v1.Hash) (name.Digest, error) {
366 // Get the registry reference for the image
367 ref, err := registry.ImageReferenceInStubRegistry(ctx, imageName)
368 if err != nil {
369 return name.Digest{}, err
370 }
371
372 // Convert to digest reference
373 return name.NewDigest(fmt.Sprintf("%s@%s", ref.Context().Name(), digest.String()))
374}
375
376// CreateAndPushImageSignatureReferrer creates a signature for a named image using OCI Referrers API
377func CreateAndPushImageSignatureReferrer(ctx context.Context, imageName string, keyName string) (context.Context, error) {

Calls 3

NameMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected