diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-01 09:17:35 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-01 09:17:35 -0400 |
commit | b425a4f4ac9528a03e97989ad80efa2bf607dd54 (patch) | |
tree | c7eed0eb87475c7020575f1b1ec19efb190c0a58 /cmd | |
parent | de460bf97891055fe34bf1540a5f29b45b6771a8 (diff) | |
parent | 02eefe650c8e13cf046844080656c6d1114f1625 (diff) | |
download | podman-b425a4f4ac9528a03e97989ad80efa2bf607dd54.tar.gz podman-b425a4f4ac9528a03e97989ad80efa2bf607dd54.tar.bz2 podman-b425a4f4ac9528a03e97989ad80efa2bf607dd54.zip |
Merge pull request #7171 from jwhonce/wip/varlink_timeout
Fix podman service --valink timeout
Diffstat (limited to 'cmd')
-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 2d511f0ec..7c692b07e 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()) } |