aboutsummaryrefslogtreecommitdiff
path: root/cmd/podmanV2/pods/stop.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-03-27 16:26:36 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-03-31 08:50:32 -0400
commit3449b27cd1743a1353ea8c4503eec5d126d04b0d (patch)
treeb4c65b7cbbc1307e6a4c021531f4b7a1e53b4c8d /cmd/podmanV2/pods/stop.go
parent9c7410d331ed6c9af50babb41314bfa67a3f39e0 (diff)
downloadpodman-3449b27cd1743a1353ea8c4503eec5d126d04b0d.tar.gz
podman-3449b27cd1743a1353ea8c4503eec5d126d04b0d.tar.bz2
podman-3449b27cd1743a1353ea8c4503eec5d126d04b0d.zip
Switch to using --time as opposed to --timeout to better match Docker.
We need to consistently use --time rather then --timeout throughout the code. Fix locations where timeout defaults are not set correctly as well. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podmanV2/pods/stop.go')
-rw-r--r--cmd/podmanV2/pods/stop.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/podmanV2/pods/stop.go b/cmd/podmanV2/pods/stop.go
index 2b61850e2..403c7d95d 100644
--- a/cmd/podmanV2/pods/stop.go
+++ b/cmd/podmanV2/pods/stop.go
@@ -26,7 +26,7 @@ var (
},
Example: `podman pod stop mywebserverpod
podman pod stop --latest
- podman pod stop --timeout 0 490eb 3557fb`,
+ podman pod stop --time 0 490eb 3557fb`,
}
)
@@ -47,19 +47,20 @@ func init() {
flags.BoolVarP(&stopOptions.All, "all", "a", false, "Stop all running pods")
flags.BoolVarP(&stopOptions.Ignore, "ignore", "i", false, "Ignore errors when a specified pod is missing")
flags.BoolVarP(&stopOptions.Latest, "latest", "l", false, "Stop the latest pod podman is aware of")
- flags.UintVarP(&timeout, "timeout", "t", 0, "Seconds to wait for pod stop before killing the container")
+ flags.UintVarP(&timeout, "time", "t", 0, "Seconds to wait for pod stop before killing the container")
if registry.IsRemote() {
_ = flags.MarkHidden("latest")
_ = flags.MarkHidden("ignore")
}
+ flags.SetNormalizeFunc(utils.AliasFlags)
}
func stop(cmd *cobra.Command, args []string) error {
var (
errs utils.OutputErrors
)
- if cmd.Flag("timeout").Changed {
+ if cmd.Flag("time").Changed {
stopOptions.Timeout = int(timeout)
}
responses, err := registry.ContainerEngine().PodStop(context.Background(), args, stopOptions)