summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/tunnel/generate.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-07 15:51:41 +0200
committerGitHub <noreply@github.com>2021-09-07 15:51:41 +0200
commit8a55363b80a012b6c6e774957ac477d0fd540a5e (patch)
tree97baa90a5f4364ff6731921649441407625fecd7 /pkg/domain/infra/tunnel/generate.go
parentc20227bd16cae98247955b14f6dfea33a26c6a0b (diff)
parentd1573b95e3427efae21da784e3112c5fb3d463fb (diff)
downloadpodman-8a55363b80a012b6c6e774957ac477d0fd540a5e.tar.gz
podman-8a55363b80a012b6c6e774957ac477d0fd540a5e.tar.bz2
podman-8a55363b80a012b6c6e774957ac477d0fd540a5e.zip
Merge pull request #11459 from vrothberg/fix-11438
generate systemd: handle --restart
Diffstat (limited to 'pkg/domain/infra/tunnel/generate.go')
-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)
}