diff options
author | Jhon Honce <jhonce@redhat.com> | 2020-07-31 10:11:21 -0700 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-08-11 13:53:23 +0200 |
commit | 3262f77406c597652e5cdbf6585a0c4f3bb30436 (patch) | |
tree | 3b4f3fcbf98f66a2fbcfef4a89d9ce5f9cbda6c0 | |
parent | 1752851958145f65e50cef5fab3e114487fcb63a (diff) | |
download | podman-3262f77406c597652e5cdbf6585a0c4f3bb30436.tar.gz podman-3262f77406c597652e5cdbf6585a0c4f3bb30436.tar.bz2 podman-3262f77406c597652e5cdbf6585a0c4f3bb30436.zip |
Fix podman service --valink timeout
Documentation and unit files call for a millisecond timeout while the
code was using a second resolution. Code change is smaller given
varlink has been deprecated.
Signed-off-by: Jhon Honce <jhonce@redhat.com>
-rw-r--r-- | cmd/podman/system/service.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/podman/system/service.go b/cmd/podman/system/service.go index 312fcda19..28080bc4d 100644 --- a/cmd/podman/system/service.go +++ b/cmd/podman/system/service.go @@ -49,7 +49,7 @@ 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.BoolVar(&srvArgs.Varlink, "varlink", false, "Use legacy varlink service instead of REST") + flags.BoolVar(&srvArgs.Varlink, "varlink", false, "Use legacy varlink service instead of REST. Unit of --time changes from seconds to milliseconds.") _ = flags.MarkDeprecated("varlink", "valink API is deprecated.") flags.SetNormalizeFunc(aliasTimeoutFlag) @@ -88,14 +88,15 @@ func service(cmd *cobra.Command, args []string) error { opts := entities.ServiceOptions{ URI: apiURI, - Timeout: time.Duration(srvArgs.Timeout) * time.Second, Command: cmd, } if srvArgs.Varlink { + opts.Timeout = time.Duration(srvArgs.Timeout) * time.Millisecond return registry.ContainerEngine().VarlinkService(registry.GetContext(), opts) } + opts.Timeout = time.Duration(srvArgs.Timeout) * time.Second return restService(opts, cmd.Flags(), registry.PodmanConfig()) } |