Merge pull request #3334 from vrothberg/fix-3331

pkg/apparmor: fix when AA is disabled
This commit is contained in:
OpenShift Merge Robot
2019-06-14 21:24:53 +02:00
committed by GitHub

View File

@ -225,9 +225,14 @@ func CheckProfileAndLoadDefault(name string) (string, error) {
} }
} }
if name != "" && !runcaa.IsEnabled() { // Check if AppArmor is disabled and error out if a profile is to be set.
if !runcaa.IsEnabled() {
if name == "" {
return "", nil
} else {
return "", fmt.Errorf("profile %q specified but AppArmor is disabled on the host", name) return "", fmt.Errorf("profile %q specified but AppArmor is disabled on the host", name)
} }
}
// If the specified name is not empty or is not a default libpod one, // If the specified name is not empty or is not a default libpod one,
// ignore it and return the name. // ignore it and return the name.