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

Function readPathsFromRecordFile

pkg/cmd/image/convert.go:402–422  ·  view source on GitHub ↗
(filename string)

Source from the content-addressed store, hash-verified

400}
401
402func readPathsFromRecordFile(filename string) ([]string, error) {
403 r, err := os.Open(filename)
404 if err != nil {
405 return nil, err
406 }
407 defer r.Close()
408 dec := json.NewDecoder(r)
409 var paths []string
410 added := make(map[string]struct{})
411 for dec.More() {
412 var e recorder.Entry
413 if err := dec.Decode(&e); err != nil {
414 return nil, err
415 }
416 if _, ok := added[e.Path]; !ok {
417 paths = append(paths, e.Path)
418 added[e.Path] = struct{}{}
419 }
420 }
421 return paths, nil
422}
423
424func printConvertedImage(stdout io.Writer, options types.ImageConvertOptions, img converterutil.ConvertedImageInfo) error {
425 switch options.Format {

Callers 2

getESGZConvertOptsFunction · 0.85
getZstdchunkedConverterFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…