MCPcopy Create free account
hub / github.com/containerd/nerdctl / eStargzConvertFunc

Function eStargzConvertFunc

pkg/cmd/image/push.go:202–217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200}
201
202func eStargzConvertFunc() converter.ConvertFunc {
203 convertToESGZ := estargzconvert.LayerConvertFunc()
204 return func(ctx context.Context, cs content.Store, desc ocispec.Descriptor) (*ocispec.Descriptor, error) {
205 if isReusableESGZ(ctx, cs, desc) {
206 log.L.Infof("reusing estargz %s without conversion", desc.Digest)
207 return nil, nil
208 }
209 newDesc, err := convertToESGZ(ctx, cs, desc)
210 if err != nil {
211 return nil, err
212 }
213 log.L.Infof("converted %q to %s", desc.MediaType, newDesc.Digest)
214 return newDesc, err
215 }
216
217}
218
219func isReusableESGZ(ctx context.Context, cs content.Store, desc ocispec.Descriptor) bool {
220 dgstStr, ok := desc.Annotations[estargz.TOCJSONDigestAnnotation]

Callers 1

PushFunction · 0.85

Calls 1

isReusableESGZFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…