summaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorValentin Rothberg <vrothberg@redhat.com>2022-08-05 14:22:54 +0200
committerValentin Rothberg <vrothberg@redhat.com>2022-08-10 21:10:17 +0200
commit3fc126e152d5ebe4bfef980dea04192762628773 (patch)
tree8fb7514960cf0c2c3ef9de12e463b53668cbe204 /pkg/specgen
parent67a2e7351b0cea00ba455c0c4e52e13898fec203 (diff)
downloadpodman-3fc126e152d5ebe4bfef980dea04192762628773.tar.gz
podman-3fc126e152d5ebe4bfef980dea04192762628773.tar.bz2
podman-3fc126e152d5ebe4bfef980dea04192762628773.zip
libpod: allow the notify socket to be passed programatically
The notify socket can now either be specified via an environment variable or programatically (where the env is ignored). The notify mode and the socket are now also displayed in `container inspect` which comes in handy for debugging and allows for propper testing. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/generate/container_create.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index 8334d386f..f4c67e534 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -5,6 +5,7 @@ import (
"encoding/json"
"errors"
"fmt"
+ "os"
"path/filepath"
"strings"
@@ -353,6 +354,10 @@ func createContainerOptions(rt *libpod.Runtime, s *specgen.SpecGenerator, pod *l
if len(s.SdNotifyMode) > 0 {
options = append(options, libpod.WithSdNotifyMode(s.SdNotifyMode))
}
+ if notify, ok := os.LookupEnv("NOTIFY_SOCKET"); ok {
+ options = append(options, libpod.WithSdNotifySocket(notify))
+ }
+
if pod != nil {
logrus.Debugf("adding container to pod %s", pod.Name())
options = append(options, rt.WithPod(pod))