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

Function ImageReferenceInStubRegistry

acceptance/registry/registry.go:135–149  ·  view source on GitHub ↗

ImageReferenceInStubRegistry returns a reference for an image constructed by concatenating the host:port/`imageName`

(ctx context.Context, imageName string)

Source from the content-addressed store, hash-verified

133// ImageReferenceInStubRegistry returns a reference for an image constructed by concatenating
134// the host:port/`imageName`
135func ImageReferenceInStubRegistry(ctx context.Context, imageName string) (name.Reference, error) {
136 registry, err := StubRegistry(ctx)
137 if err != nil {
138 return nil, err
139 }
140
141 imageRef := registry + "/" + imageName
142
143 ref, err := name.ParseReference(imageRef)
144 if err != nil {
145 panic(errors.Wrapf(err, "unable to parse image reference: %s", imageRef))
146 }
147
148 return ref, nil
149}
150
151// StubRegistry returns the host:port of the stubbed registry from the Context
152func StubRegistry(ctx context.Context) (string, error) {

Callers 9

getDigestRefForImageFunction · 0.92
createAndPushLayerFunction · 0.92
createAndPushPlainImageFunction · 0.92
stealFunction · 0.92
createTektonBundleFunction · 0.92

Calls 1

StubRegistryFunction · 0.85

Tested by

no test coverage detected