diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-05-22 06:16:03 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-05-22 12:55:23 -0400 |
commit | 35567e706b5009ead40c0eaef7c5c1199cd8d448 (patch) | |
tree | b3b35b1b94a8521f1ac08c85cdd514172e4ea554 /cmd/podman/system | |
parent | c8d64264c924833440237bf766a05db0cea56a1c (diff) | |
download | podman-35567e706b5009ead40c0eaef7c5c1199cd8d448.tar.gz podman-35567e706b5009ead40c0eaef7c5c1199cd8d448.tar.bz2 podman-35567e706b5009ead40c0eaef7c5c1199cd8d448.zip |
Attempt to turn on additional build tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/system')
-rw-r--r-- | cmd/podman/system/service.go | 14 | ||||
-rw-r--r-- | cmd/podman/system/varlink.go | 13 |
2 files changed, 17 insertions, 10 deletions
diff --git a/cmd/podman/system/service.go b/cmd/podman/system/service.go index b5dd2f2aa..221738f33 100644 --- a/cmd/podman/system/service.go +++ b/cmd/podman/system/service.go @@ -26,13 +26,12 @@ Enable a listening service for API access to Podman commands. ` srvCmd = &cobra.Command{ - Use: "service [flags] [URI]", - Args: cobra.MaximumNArgs(1), - Short: "Run API service", - Long: srvDescription, - RunE: service, - Example: `podman system service --time=0 unix:///tmp/podman.sock - podman system service --varlink --time=0 unix:///tmp/podman.sock`, + Use: "service [flags] [URI]", + Args: cobra.MaximumNArgs(1), + Short: "Run API service", + Long: srvDescription, + RunE: service, + Example: `podman system service --time=0 unix:///tmp/podman.sock`, } srvArgs = struct { @@ -50,7 +49,6 @@ func init() { flags := srvCmd.Flags() flags.Int64VarP(&srvArgs.Timeout, "time", "t", 5, "Time until the service session expires in seconds. Use 0 to disable the timeout") - flags.Int64Var(&srvArgs.Timeout, "timeout", 5, "Time until the service session expires in seconds. Use 0 to disable the timeout") flags.BoolVar(&srvArgs.Varlink, "varlink", false, "Use legacy varlink service instead of REST") _ = flags.MarkDeprecated("varlink", "valink API is deprecated.") diff --git a/cmd/podman/system/varlink.go b/cmd/podman/system/varlink.go index c83f5ff76..de855eba6 100644 --- a/cmd/podman/system/varlink.go +++ b/cmd/podman/system/varlink.go @@ -1,3 +1,5 @@ +// +build linux + package system import ( @@ -6,6 +8,7 @@ import ( "github.com/containers/libpod/cmd/podman/registry" "github.com/containers/libpod/pkg/domain/entities" "github.com/spf13/cobra" + "github.com/spf13/pflag" ) var ( @@ -20,7 +23,7 @@ var ( Long: varlinkDescription, RunE: varlinkE, Example: `podman varlink unix:/run/podman/io.podman - podman varlink --timeout 5000 unix:/run/podman/io.podman`, + podman varlink --time 5000 unix:/run/podman/io.podman`, } varlinkArgs = struct { Timeout int64 @@ -34,8 +37,14 @@ func init() { }) flags := varlinkCmd.Flags() flags.Int64VarP(&varlinkArgs.Timeout, "time", "t", 1000, "Time until the varlink session expires in milliseconds. Use 0 to disable the timeout") - flags.Int64Var(&varlinkArgs.Timeout, "timeout", 1000, "Time until the varlink session expires in milliseconds. Use 0 to disable the timeout") + flags.SetNormalizeFunc(aliasTimeoutFlag) +} +func aliasTimeoutFlag(_ *pflag.FlagSet, name string) pflag.NormalizedName { + if name == "timeout" { + name = "time" + } + return pflag.NormalizedName(name) } func varlinkE(cmd *cobra.Command, args []string) error { |