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

Function imageFrom

acceptance/image/image.go:143–156  ·  view source on GitHub ↗

imageFrom returns the named image from the Context

(ctx context.Context, imageName string)

Source from the content-addressed store, hash-verified

141
142// imageFrom returns the named image from the Context
143func imageFrom(ctx context.Context, imageName string) (v1.Image, error) {
144 state := testenv.FetchState[imageState](ctx)
145
146 if state.Images[imageName] == "" {
147 return nil, fmt.Errorf("can't find image info for image named %s, did you create the image beforehand", imageName)
148 }
149
150 ref, err := name.ParseReference(state.Images[imageName])
151 if err != nil {
152 return nil, err
153 }
154
155 return remote.Image(ref)
156}
157
158// CreateAndPushImageSignature for a named image in the Context creates a signature
159// image, same as `cosign sign` or Tekton Chains would, of that named image and pushes it

Callers 2

getImageDigestAndRefFunction · 0.85
stealFunction · 0.85

Calls 2

ErrorfMethod · 0.65
ImageMethod · 0.65

Tested by

no test coverage detected