MCPcopy Index your code
hub / github.com/linuxkit/linuxkit / blobsForImage

Function blobsForImage

src/cmd/linuxkit/cache/remove.go:71–91  ·  view source on GitHub ↗
(img v1.Image)

Source from the content-addressed store, hash-verified

69}
70
71func blobsForImage(img v1.Image) ([]v1.Hash, error) {
72 var blobs []v1.Hash
73 layers, err := img.Layers()
74 if err != nil {
75 // if we could not find the layers locally, that is fine;
76 // we are trying to ensure they don't exist in the cache,
77 // and they already don't exist.
78 return nil, nil
79 }
80 for _, layer := range layers {
81 dig, err := layer.Digest()
82 if err != nil {
83 return nil, err
84 }
85 blobs = append(blobs, dig)
86 }
87 if config, err := img.ConfigName(); err == nil {
88 blobs = append(blobs, config)
89 }
90 return blobs, nil
91}

Callers 1

RemoveMethod · 0.85

Calls 1

DigestMethod · 0.65

Tested by

no test coverage detected