reload default apparmor profile if it is unloaded

Signed-off-by: Xianglin Gao <xlgao@zju.edu.cn>
This commit is contained in:
Xianglin Gao 2016-12-07 19:32:50 +08:00
parent 8547c0dbd9
commit cb5ed1ce9d
8 changed files with 95 additions and 48 deletions

View file

@ -393,6 +393,11 @@ func (s *Server) getAppArmorProfileName(annotations map[string]string, ctrName s
}
if profile == apparmor.ProfileRuntimeDefault {
// reload default apparmor profile if it is unloaded.
if s.appArmorProfile == apparmor.DefaultApparmorProfile {
apparmor.LoadDefaultAppArmorProfile()
}
// If the value is runtime/default, then return default profile.
return s.appArmorProfile
}