mirror of
https://github.com/containers/podman.git
synced 2025-08-02 01:09:21 +08:00
Quadlet: Add support for --sysctl flag
The Sysctl=name=value entry can be used to set --sysctl=name=value directly without the need to use PodmanArgs=--sysctl=name=value. Signed-off-by: Laurenz Kruty <git@laurenzkruty.de>
This commit is contained in:
@ -94,6 +94,7 @@ const (
|
||||
KeySecurityLabelLevel = "SecurityLabelLevel"
|
||||
KeySecurityLabelType = "SecurityLabelType"
|
||||
KeySecret = "Secret"
|
||||
KeySysctl = "Sysctl"
|
||||
KeyTimezone = "Timezone"
|
||||
KeyTmpfs = "Tmpfs"
|
||||
KeyType = "Type"
|
||||
@ -156,6 +157,7 @@ var (
|
||||
KeySecurityLabelLevel: true,
|
||||
KeySecurityLabelType: true,
|
||||
KeySecret: true,
|
||||
KeySysctl: true,
|
||||
KeyTmpfs: true,
|
||||
KeyTimezone: true,
|
||||
KeyUser: true,
|
||||
@ -458,6 +460,11 @@ func ConvertContainer(container *parser.UnitFile, isUser bool) (*parser.UnitFile
|
||||
podman.addf("--cap-add=%s", strings.ToLower(caps))
|
||||
}
|
||||
|
||||
sysctl := container.LookupAllStrv(ContainerGroup, KeySysctl)
|
||||
for _, sysctlItem := range sysctl {
|
||||
podman.addf("--sysctl=%s", sysctlItem)
|
||||
}
|
||||
|
||||
readOnly, ok := container.LookupBoolean(ContainerGroup, KeyReadOnly)
|
||||
if ok {
|
||||
podman.addBool("--read-only", readOnly)
|
||||
|
Reference in New Issue
Block a user