diff options
author | Valentin Rothberg <vrothberg@redhat.com> | 2022-08-05 14:22:54 +0200 |
---|---|---|
committer | Valentin Rothberg <vrothberg@redhat.com> | 2022-08-10 21:10:17 +0200 |
commit | 3fc126e152d5ebe4bfef980dea04192762628773 (patch) | |
tree | 8fb7514960cf0c2c3ef9de12e463b53668cbe204 /pkg/specgen/generate | |
parent | 67a2e7351b0cea00ba455c0c4e52e13898fec203 (diff) | |
download | podman-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/generate')
-rw-r--r-- | pkg/specgen/generate/container_create.go | 5 |
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)) |