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

Function List

pkg/cmd/volume/list.go:47–73  ·  view source on GitHub ↗
(options types.VolumeListOptions)

Source from the content-addressed store, hash-verified

45}
46
47func List(options types.VolumeListOptions) error {
48 if options.Quiet && options.Size {
49 log.L.Warn("cannot use --size and --quiet together, ignoring --size")
50 options.Size = false
51 }
52 sizeFilter := hasSizeFilter(options.Filters)
53 if sizeFilter && options.Quiet {
54 log.L.Warn("cannot use --filter=size and --quiet together, ignoring --filter=size")
55 options.Filters = removeSizeFilters(options.Filters)
56 }
57 if sizeFilter && !options.Size {
58 log.L.Warn("should use --filter=size and --size together")
59 options.Size = true
60 }
61
62 vols, err := Volumes(
63 options.GOptions.Namespace,
64 options.GOptions.DataRoot,
65 options.GOptions.Address,
66 options.Size,
67 options.Filters,
68 )
69 if err != nil {
70 return err
71 }
72 return lsPrintOutput(vols, options)
73}
74
75func hasSizeFilter(filters []string) bool {
76 for _, filter := range filters {

Callers 1

listActionFunction · 0.92

Calls 4

hasSizeFilterFunction · 0.85
removeSizeFiltersFunction · 0.85
VolumesFunction · 0.85
lsPrintOutputFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…