ImageReferenceInStubRegistry returns a reference for an image constructed by concatenating the host:port/`imageName`
(ctx context.Context, imageName string)
| 133 | // ImageReferenceInStubRegistry returns a reference for an image constructed by concatenating |
| 134 | // the host:port/`imageName` |
| 135 | func 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 |
| 152 | func StubRegistry(ctx context.Context) (string, error) { |
no test coverage detected