summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2020-04-28 12:21:36 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2020-04-30 11:33:34 +0200
commit32564df172659dd844c0bd72671468f058f964de (patch)
tree9f5f5ac15557a1dbe84b0182d6a6dde32b56990f /cmd
parent65d7f22720b1c5ba4b6bea1d96cd43bb5b04831d (diff)
downloadpodman-32564df172659dd844c0bd72671468f058f964de.tar.gz
podman-32564df172659dd844c0bd72671468f058f964de.tar.bz2
podman-32564df172659dd844c0bd72671468f058f964de.zip
cmd, podman: use String instead of variable+StringVar
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/create.go24
1 files changed, 6 insertions, 18 deletions
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index a0aed984c..e64b84519 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -49,9 +49,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"cap-drop", []string{},
"Drop capabilities from the container",
)
- cgroupNS := ""
- createFlags.StringVar(
- &cgroupNS,
+ createFlags.String(
"cgroupns", containerConfig.CgroupNS(),
"cgroup namespace to use",
)
@@ -248,9 +246,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"interactive", "i", false,
"Keep STDIN open even if not attached",
)
- ipcNS := ""
- createFlags.StringVar(
- &ipcNS,
+ createFlags.String(
"ipc", containerConfig.IPCNS(),
"IPC namespace to use",
)
@@ -331,9 +327,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"use `OS` instead of the running OS for choosing images",
)
// markFlagHidden(createFlags, "override-os")
- pid := ""
- createFlags.StringVar(
- &pid,
+ createFlags.String(
"pid", containerConfig.PidNS(),
"PID namespace to use",
)
@@ -397,9 +391,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"security-opt", containerConfig.SecurityOptions(),
"Security Options",
)
- shmSize := ""
- createFlags.StringVar(
- &shmSize,
+ createFlags.String(
"shm-size", containerConfig.ShmSize(),
"Size of /dev/shm "+sizeWithUnitFormat,
)
@@ -464,15 +456,11 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"user", "u", "",
"Username or UID (format: <name|uid>[:<group|gid>])",
)
- userNS := ""
- createFlags.StringVar(
- &userNS,
+ createFlags.String(
"userns", containerConfig.Containers.UserNS,
"User namespace to use",
)
- utsNS := ""
- createFlags.StringVar(
- &utsNS,
+ createFlags.String(
"uts", containerConfig.Containers.UTSNS,
"UTS namespace to use",
)