summaryrefslogtreecommitdiff
path: root/cmd/podman/generate_systemd.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/podman/generate_systemd.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/podman/generate_systemd.go')
-rw-r--r--cmd/podman/generate_systemd.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/cmd/podman/generate_systemd.go b/cmd/podman/generate_systemd.go
index a9775f9cb..fd0d13d78 100644
--- a/cmd/podman/generate_systemd.go
+++ b/cmd/podman/generate_systemd.go
@@ -43,9 +43,10 @@ func init() {
if !remoteclient {
flags.BoolVarP(&containerSystemdCommand.Files, "files", "f", false, "generate files instead of printing to stdout")
}
- flags.IntVarP(&containerSystemdCommand.StopTimeout, "timeout", "t", -1, "stop timeout override")
+ flags.UintVarP(&containerSystemdCommand.StopTimeout, "time", "t", defaultContainerConfig.Engine.StopTimeout, "stop timeout override")
flags.StringVar(&containerSystemdCommand.RestartPolicy, "restart-policy", "on-failure", "applicable systemd restart-policy")
flags.BoolVarP(&containerSystemdCommand.New, "new", "", false, "create a new container instead of starting an existing one")
+ flags.SetNormalizeFunc(aliasFlags)
}
func generateSystemdCmd(c *cliconfig.GenerateSystemdValues) error {
@@ -55,11 +56,6 @@ func generateSystemdCmd(c *cliconfig.GenerateSystemdValues) error {
}
defer runtime.DeferredShutdown(false)
- // User input stop timeout must be 0 or greater
- if c.Flag("timeout").Changed && c.StopTimeout < 0 {
- return errors.New("timeout value must be 0 or greater")
- }
-
unit, err := runtime.GenerateSystemd(c)
if err != nil {
return err