diff options
author | Ondra Machacek <omachace@redhat.com> | 2021-12-02 13:44:35 +0100 |
---|---|---|
committer | Ondra Machacek <omachace@redhat.com> | 2021-12-03 12:11:28 +0100 |
commit | c9ad1da51c6b1aa7eb531a2f9951aa853bdea109 (patch) | |
tree | 8e94a4877172747dbfa308d5db2099ddc80dd9ad /pkg/bindings/generate | |
parent | a6d1220ac08456dcc075b85b168def3ffeadb58d (diff) | |
download | podman-c9ad1da51c6b1aa7eb531a2f9951aa853bdea109.tar.gz podman-c9ad1da51c6b1aa7eb531a2f9951aa853bdea109.tar.bz2 podman-c9ad1da51c6b1aa7eb531a2f9951aa853bdea109.zip |
Add restart-sec option to systemd generate
Signed-off-by: Ondra Machacek <omachace@redhat.com>
Diffstat (limited to 'pkg/bindings/generate')
-rw-r--r-- | pkg/bindings/generate/types.go | 2 | ||||
-rw-r--r-- | pkg/bindings/generate/types_systemd_options.go | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/pkg/bindings/generate/types.go b/pkg/bindings/generate/types.go index 092474e4a..ce560c547 100644 --- a/pkg/bindings/generate/types.go +++ b/pkg/bindings/generate/types.go @@ -20,6 +20,8 @@ type SystemdOptions struct { TemplateUnitFile *bool // RestartPolicy - systemd restart policy. RestartPolicy *string + // RestartSec - systemd service restartsec. Configures the time to sleep before restarting a service. + RestartSec *uint // StartTimeout - time when starting the container. StartTimeout *uint // StopTimeout - time when stopping the container. diff --git a/pkg/bindings/generate/types_systemd_options.go b/pkg/bindings/generate/types_systemd_options.go index d60f1d70e..504d4da7f 100644 --- a/pkg/bindings/generate/types_systemd_options.go +++ b/pkg/bindings/generate/types_systemd_options.go @@ -92,6 +92,21 @@ func (o *SystemdOptions) GetRestartPolicy() string { return *o.RestartPolicy } +// WithRestartSec set field RestartSec to given value +func (o *SystemdOptions) WithRestartSec(value uint) *SystemdOptions { + o.RestartSec = &value + return o +} + +// GetRestartSec returns value of field RestartSec +func (o *SystemdOptions) GetRestartSec() uint { + if o.RestartSec == nil { + var z uint + return z + } + return *o.RestartSec +} + // WithStartTimeout set field StartTimeout to given value func (o *SystemdOptions) WithStartTimeout(value uint) *SystemdOptions { o.StartTimeout = &value |