getImage loads the specified image object.
(ctx context.Context, imageStreamImageName string)
| 133 | |
| 134 | // getImage loads the specified image object. |
| 135 | func (c *openshiftClient) getImage(ctx context.Context, imageStreamImageName string) (*image, error) { |
| 136 | // FIXME: validate components per validation.IsValidPathSegmentName? |
| 137 | path := fmt.Sprintf("/oapi/v1/namespaces/%s/imagestreamimages/%s@%s", c.ref.namespace, c.ref.stream, imageStreamImageName) |
| 138 | body, err := c.doRequest(ctx, http.MethodGet, path, nil) |
| 139 | if err != nil { |
| 140 | return nil, err |
| 141 | } |
| 142 | // Note: This does absolutely no kind/version checking or conversions. |
| 143 | var isi imageStreamImage |
| 144 | if err := json.Unmarshal(body, &isi); err != nil { |
| 145 | return nil, err |
| 146 | } |
| 147 | return &isi.Image, nil |
| 148 | } |
| 149 | |
| 150 | // convertDockerImageReference takes an image API DockerImageReference value and returns a reference we can actually use; |
| 151 | // currently OpenShift stores the cluster-internal service IPs here, which are unusable from the outside. |
no test coverage detected