MCPcopy
hub / github.com/containerd/containerd / Spec

Method Spec

client/image.go:229–247  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

227}
228
229func (i *image) Spec(ctx context.Context) (ocispec.Image, error) {
230 var ociImage ocispec.Image
231
232 desc, err := i.Config(ctx)
233 if err != nil {
234 return ociImage, fmt.Errorf("get image config descriptor: %w", err)
235 }
236
237 blob, err := content.ReadBlob(ctx, i.ContentStore(), desc)
238 if err != nil {
239 return ociImage, fmt.Errorf("read image config from content store: %w", err)
240 }
241
242 if err := json.Unmarshal(blob, &ociImage); err != nil {
243 return ociImage, fmt.Errorf("unmarshal image config %s: %w", blob, err)
244 }
245
246 return ociImage, nil
247}
248
249// UnpackConfig provides configuration for the unpack of an image
250type UnpackConfig struct {

Callers

nothing calls this directly

Calls 4

ConfigMethod · 0.95
ContentStoreMethod · 0.95
ReadBlobFunction · 0.92
UnmarshalMethod · 0.80

Tested by

no test coverage detected