diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-16 11:56:16 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-16 11:56:16 -0700 |
commit | 57f3897289e886bbc775584f430f65a8765e4301 (patch) | |
tree | 48d126d08e768d91b8c0a9f20e68b8bd98b8f36e /cmd/podmanV2/common/create.go | |
parent | 8b178f12ce34b1ac2b14c1e56cb6e5b3937f7122 (diff) | |
parent | 1d93d212541616135da23bcf01ca49180f113e62 (diff) | |
download | podman-57f3897289e886bbc775584f430f65a8765e4301.tar.gz podman-57f3897289e886bbc775584f430f65a8765e4301.tar.bz2 podman-57f3897289e886bbc775584f430f65a8765e4301.zip |
Merge pull request #5848 from jwhonce/wip/options
V2 Enable rootless
Diffstat (limited to 'cmd/podmanV2/common/create.go')
-rw-r--r-- | cmd/podmanV2/common/create.go | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/cmd/podmanV2/common/create.go b/cmd/podmanV2/common/create.go index ecaaf38fb..0b2f4532c 100644 --- a/cmd/podmanV2/common/create.go +++ b/cmd/podmanV2/common/create.go @@ -2,30 +2,15 @@ package common import ( "fmt" - "os" buildahcli "github.com/containers/buildah/pkg/cli" - "github.com/containers/common/pkg/config" - "github.com/sirupsen/logrus" + "github.com/containers/libpod/cmd/podmanV2/registry" "github.com/spf13/pflag" ) -const ( - sizeWithUnitFormat = "(format: `<number>[<unit>]`, where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes))" -) - -var ( - defaultContainerConfig = getDefaultContainerConfig() -) +const sizeWithUnitFormat = "(format: `<number>[<unit>]`, where unit = b (bytes), k (kilobytes), m (megabytes), or g (gigabytes))" -func getDefaultContainerConfig() *config.Config { - defaultContainerConfig, err := config.Default() - if err != nil { - logrus.Error(err) - os.Exit(1) - } - return defaultContainerConfig -} +var containerConfig = registry.NewPodmanConfig() func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { createFlags := pflag.FlagSet{} @@ -337,13 +322,13 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { "override-arch", "", "use `ARCH` instead of the architecture of the machine for choosing images", ) - //markFlagHidden(createFlags, "override-arch") + // markFlagHidden(createFlags, "override-arch") createFlags.StringVar( &cf.OverrideOS, "override-os", "", "use `OS` instead of the running OS for choosing images", ) - //markFlagHidden(createFlags, "override-os") + // markFlagHidden(createFlags, "override-os") createFlags.StringVar( &cf.PID, "pid", getDefaultPidNS(), @@ -407,7 +392,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { createFlags.StringArrayVar( &cf.SecurityOpt, "security-opt", getDefaultSecurityOptions(), - fmt.Sprintf("Security Options"), + "Security Options", ) createFlags.StringVar( &cf.ShmSize, @@ -421,7 +406,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { ) createFlags.UintVar( &cf.StopTimeout, - "stop-timeout", defaultContainerConfig.Engine.StopTimeout, + "stop-timeout", containerConfig.Engine.StopTimeout, "Timeout (in seconds) to stop a container. Default is 10", ) createFlags.StringSliceVar( @@ -513,7 +498,7 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet { return &createFlags } -func AliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName { +func AliasFlags(_ *pflag.FlagSet, name string) pflag.NormalizedName { switch name { case "healthcheck-command": name = "health-cmd" |