getApparmorSecurityOpts gets apparmor options from container config.
( sc *runtimeapi.LinuxContainerSecurityContext, separator rune, )
| 301 | |
| 302 | // getApparmorSecurityOpts gets apparmor options from container config. |
| 303 | func 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 | |
| 320 | func getAppArmorOpts(profile string) ([]DockerOpt, error) { |
| 321 | if profile == "" || profile == config.AppArmorBetaProfileRuntimeDefault { |
searching dependent graphs…