summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/containers.go
diff options
context:
space:
mode:
authoropenshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com>2021-08-06 12:26:31 +0000
committerGitHub <noreply@github.com>2021-08-06 12:26:31 +0000
commit840981773325499c241d518ffbda06762cfdc759 (patch)
tree10b1d1f80c82b3c8d58864a9669cdcfd3ff7620d /pkg/systemd/generate/containers.go
parent0eb2a02620e28383d3e4458854411f277d1e30f7 (diff)
parent30df551bde460f4f37d6dbd373701873fa5353dc (diff)
downloadpodman-840981773325499c241d518ffbda06762cfdc759.tar.gz
podman-840981773325499c241d518ffbda06762cfdc759.tar.bz2
podman-840981773325499c241d518ffbda06762cfdc759.zip
Merge pull request #11074 from vrothberg/auto-update-rollback
auto-update: simple rollback
Diffstat (limited to 'pkg/systemd/generate/containers.go')
-rw-r--r--pkg/systemd/generate/containers.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go
index 083520316..78b81b54b 100644
--- a/pkg/systemd/generate/containers.go
+++ b/pkg/systemd/generate/containers.go
@@ -258,7 +258,6 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
}
startCommand = append(startCommand,
"run",
- "--sdnotify=conmon",
"--cgroups=no-conmon",
"--rm",
)
@@ -273,6 +272,7 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
fs.String("name", "", "")
fs.Bool("replace", false, "")
fs.StringArrayP("env", "e", nil, "")
+ fs.String("sdnotify", "", "")
fs.Parse(remainingCmd)
remainingCmd = filterCommonContainerFlags(remainingCmd, fs.NArg())
@@ -294,6 +294,13 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
return "", err
}
+ // Default to --sdnotify=conmon unless already set by the
+ // container.
+ hasSdnotifyParam := fs.Lookup("sdnotify").Changed
+ if !hasSdnotifyParam {
+ startCommand = append(startCommand, "--sdnotify=conmon")
+ }
+
if !hasDetachParam {
// Enforce detaching
//