mirror of
https://github.com/containers/podman.git
synced 2025-06-20 17:13:43 +08:00
Strip defaults from namespace flags
We were picking up defaults from the client's containers.conf, which broke pod namespaces. The server-side code already checks containers.conf when not explicitly overridden by the user, or by the container being part of a pod (the last bit being our bug). This only manifested on systems with a containers.conf installed, so RHEL 8 and Fedora 32 (which means our F32 CI VMs likely should have caught it, but didn't, which is concerning). This prevents defaults for these flags being shown, but they were incorrect anyways for `podman-remote`, so I'm not terribly concerned. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
@ -50,7 +50,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
|
|||||||
"Drop capabilities from the container",
|
"Drop capabilities from the container",
|
||||||
)
|
)
|
||||||
createFlags.String(
|
createFlags.String(
|
||||||
"cgroupns", containerConfig.CgroupNS(),
|
"cgroupns", "",
|
||||||
"cgroup namespace to use",
|
"cgroup namespace to use",
|
||||||
)
|
)
|
||||||
createFlags.StringVar(
|
createFlags.StringVar(
|
||||||
@ -244,7 +244,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
|
|||||||
"Keep STDIN open even if not attached",
|
"Keep STDIN open even if not attached",
|
||||||
)
|
)
|
||||||
createFlags.String(
|
createFlags.String(
|
||||||
"ipc", containerConfig.IPCNS(),
|
"ipc", "",
|
||||||
"IPC namespace to use",
|
"IPC namespace to use",
|
||||||
)
|
)
|
||||||
createFlags.StringVar(
|
createFlags.StringVar(
|
||||||
@ -325,7 +325,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
|
|||||||
)
|
)
|
||||||
// markFlagHidden(createFlags, "override-os")
|
// markFlagHidden(createFlags, "override-os")
|
||||||
createFlags.String(
|
createFlags.String(
|
||||||
"pid", containerConfig.PidNS(),
|
"pid", "",
|
||||||
"PID namespace to use",
|
"PID namespace to use",
|
||||||
)
|
)
|
||||||
createFlags.Int64Var(
|
createFlags.Int64Var(
|
||||||
@ -454,11 +454,11 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
|
|||||||
"Username or UID (format: <name|uid>[:<group|gid>])",
|
"Username or UID (format: <name|uid>[:<group|gid>])",
|
||||||
)
|
)
|
||||||
createFlags.String(
|
createFlags.String(
|
||||||
"userns", containerConfig.Containers.UserNS,
|
"userns", "",
|
||||||
"User namespace to use",
|
"User namespace to use",
|
||||||
)
|
)
|
||||||
createFlags.String(
|
createFlags.String(
|
||||||
"uts", containerConfig.Containers.UTSNS,
|
"uts", "",
|
||||||
"UTS namespace to use",
|
"UTS namespace to use",
|
||||||
)
|
)
|
||||||
createFlags.StringArrayVar(
|
createFlags.StringArrayVar(
|
||||||
|
Reference in New Issue
Block a user