MCPcopy Create free account
hub / github.com/containers/image / getImage

Method getImage

openshift/openshift.go:135–148  ·  view source on GitHub ↗

getImage loads the specified image object.

(ctx context.Context, imageStreamImageName string)

Source from the content-addressed store, hash-verified

133
134// getImage loads the specified image object.
135func (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.

Callers 2

Calls 1

doRequestMethod · 0.95

Tested by

no test coverage detected