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

Function NewMatchComparer

pkg/platformutil/platformutil.go:42–52  ·  view source on GitHub ↗

NewMatchComparer returns MatchComparer. If all is true, NewMatchComparer always returns All, regardless to the value of ss. If all is false and ss is empty, NewMatchComparer returns DefaultStrict (not Default). Otherwise NewMatchComparer returns Ordered MatchComparer.

(all bool, ss []string)

Source from the content-addressed store, hash-verified

40// If all is false and ss is empty, NewMatchComparer returns DefaultStrict (not Default).
41// Otherwise NewMatchComparer returns Ordered MatchComparer.
42func NewMatchComparer(all bool, ss []string) (platforms.MatchComparer, error) {
43 if all {
44 return platforms.All, nil
45 }
46 if len(ss) == 0 {
47 // return DefaultStrict, not Default
48 return platforms.DefaultStrict(), nil
49 }
50 op, err := NewOCISpecPlatformSlice(false, ss)
51 return platforms.Ordered(op...), err
52}
53
54// NewOCISpecPlatformSlice returns a slice of ocispec.Platform
55// If all is true, NewOCISpecPlatformSlice always returns an empty slice, regardless to the value of ss.

Callers 9

FromArchiveFunction · 0.92
ConvertFunction · 0.92
PushFunction · 0.92
CryptFunction · 0.92
SaveFunction · 0.92
TagFunction · 0.92
BuildFunction · 0.92
PushFunction · 0.92

Calls 1

NewOCISpecPlatformSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…