imageFrom returns the named image from the Context
(ctx context.Context, imageName string)
| 141 | |
| 142 | // imageFrom returns the named image from the Context |
| 143 | func 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 |
no test coverage detected