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

Function WithDigest

internal/utils/testing_image.go:29–33  ·  view source on GitHub ↗

WithDigest appends a digest to the given image reference.

(ref string)

Source from the content-addressed store, hash-verified

27
28// WithDigest appends a digest to the given image reference.
29func WithDigest(ref string) string {
30 checksum := sha256.New()
31 checksum.Write([]byte(ref))
32 return fmt.Sprintf("%s@sha256:%x", ref, checksum.Sum(nil))
33}

Callers 4

WithTestImageConfigFunction · 0.92
TestFetchImageConfigFunction · 0.92
TestFetchParentImageFunction · 0.92

Calls 1

WriteMethod · 0.45

Tested by 3

TestFetchImageConfigFunction · 0.74
TestFetchParentImageFunction · 0.74