mirror of
https://github.com/containers/podman.git
synced 2025-11-28 17:18:58 +08:00
Add AppArmor key to quadlet .container files
Fixes: #27095 Signed-off-by: givensuman <givensuman@duck.com>
This commit is contained in:
@@ -62,6 +62,7 @@ const (
|
||||
KeyAddHost = "AddHost"
|
||||
KeyAllTags = "AllTags"
|
||||
KeyAnnotation = "Annotation"
|
||||
KeyAppArmor = "AppArmor"
|
||||
KeyArch = "Arch"
|
||||
KeyArtifact = "Artifact"
|
||||
KeyAuthFile = "AuthFile"
|
||||
@@ -248,6 +249,7 @@ var (
|
||||
KeyAddDevice: true,
|
||||
KeyAddHost: true,
|
||||
KeyAnnotation: true,
|
||||
KeyAppArmor: true,
|
||||
KeyAutoUpdate: true,
|
||||
KeyCgroupsMode: true,
|
||||
KeyContainerName: true,
|
||||
@@ -775,6 +777,11 @@ func ConvertContainer(container *parser.UnitFile, unitsInfoMap map[string]*UnitI
|
||||
podman.add("--security-opt", fmt.Sprintf("label=level:%s", securityLabelLevel))
|
||||
}
|
||||
|
||||
apparmor, hasApparmor := container.Lookup(ContainerGroup, KeyAppArmor)
|
||||
if hasApparmor && len(apparmor) > 0 {
|
||||
podman.add("--security-opt", fmt.Sprintf("apparmor=%s", apparmor))
|
||||
}
|
||||
|
||||
devices := container.LookupAllStrv(ContainerGroup, KeyAddDevice)
|
||||
for _, device := range devices {
|
||||
if device[0] == '-' {
|
||||
|
||||
Reference in New Issue
Block a user