MCPcopy Create free account
hub / github.com/Mirantis/cri-dockerd / getApparmorSecurityOpts

Function getApparmorSecurityOpts

core/security_context.go:303–318  ·  view source on GitHub ↗

getApparmorSecurityOpts gets apparmor options from container config.

(
	sc *runtimeapi.LinuxContainerSecurityContext,
	separator rune,
)

Source from the content-addressed store, hash-verified

301
302// getApparmorSecurityOpts gets apparmor options from container config.
303func getApparmorSecurityOpts(
304 sc *runtimeapi.LinuxContainerSecurityContext,
305 separator rune,
306) ([]string, error) {
307 if sc == nil || sc.ApparmorProfile == "" {
308 return nil, nil
309 }
310
311 appArmorOpts, err := getAppArmorOpts(sc.ApparmorProfile)
312 if err != nil {
313 return nil, err
314 }
315
316 fmtOpts := FmtDockerOpts(appArmorOpts, separator)
317 return fmtOpts, nil
318}
319
320func getAppArmorOpts(profile string) ([]DockerOpt, error) {
321 if profile == "" || profile == config.AppArmorBetaProfileRuntimeDefault {

Callers 2

modifyHostConfigFunction · 0.85

Calls 2

getAppArmorOptsFunction · 0.85
FmtDockerOptsFunction · 0.85

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…