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

Function canonicalizeCapName

pkg/cmd/container/run_security_linux.go:176–189  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

174}
175
176func canonicalizeCapName(s string) string {
177 if s == "" {
178 return ""
179 }
180 s = strings.ToUpper(s)
181 if !strings.HasPrefix(s, "CAP_") {
182 s = "CAP_" + s
183 }
184 if !isKnownCapName(s) {
185 log.L.Warnf("unknown capability name %q", s)
186 // Not a fatal error, because runtime might be aware of this cap
187 }
188 return s
189}
190
191var (
192 knownCapNames map[string]struct{}

Callers 1

generateCapOptsFunction · 0.85

Calls 1

isKnownCapNameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…