summaryrefslogtreecommitdiff
path: root/pkg/domain/infra
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-09-06 14:49:59 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-09-07 13:58:11 +0200
commitd1573b95e3427efae21da784e3112c5fb3d463fb (patch)
treeda311feeab3105d4577a7d5c4a9a1dc3027603aa /pkg/domain/infra
parente095667ac8c2ccaf06dea6d4c61f51d93b736968 (diff)
downloadpodman-d1573b95e3427efae21da784e3112c5fb3d463fb.tar.gz
podman-d1573b95e3427efae21da784e3112c5fb3d463fb.tar.bz2
podman-d1573b95e3427efae21da784e3112c5fb3d463fb.zip
generate systemd: handle --restart
Handle custom restart policies of containers when generating the unit files; those should be set on the unit level and removed from ExecStart flags. Fixes: #11438 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/domain/infra')
-rw-r--r--pkg/domain/infra/tunnel/generate.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/domain/infra/tunnel/generate.go b/pkg/domain/infra/tunnel/generate.go
index 3d3cd52be..9f69abb1a 100644
--- a/pkg/domain/infra/tunnel/generate.go
+++ b/pkg/domain/infra/tunnel/generate.go
@@ -9,7 +9,10 @@ import (
func (ic *ContainerEngine) GenerateSystemd(ctx context.Context, nameOrID string, opts entities.GenerateSystemdOptions) (*entities.GenerateSystemdReport, error) {
options := new(generate.SystemdOptions).WithUseName(opts.Name).WithContainerPrefix(opts.ContainerPrefix).WithNew(opts.New).WithNoHeader(opts.NoHeader)
- options.WithPodPrefix(opts.PodPrefix).WithRestartPolicy(opts.RestartPolicy).WithSeparator(opts.Separator)
+ options.WithPodPrefix(opts.PodPrefix).WithSeparator(opts.Separator)
+ if opts.RestartPolicy != nil {
+ options.WithRestartPolicy(*opts.RestartPolicy)
+ }
if to := opts.StopTimeout; to != nil {
options.WithStopTimeout(*opts.StopTimeout)
}