summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2020-08-11 13:29:17 +0200
committerChristian Heimes <cheimes@redhat.com>2020-08-11 13:29:17 +0200
commit846d4c2e0139d75d3ff082b9140921dcd657149c (patch)
tree35aafc62e70cc57e5b50bc760f17b05f29e01b46 /pkg/specgen/generate
parent1ae8d2f096e323ad71a8cf8aaf1800d23f29181e (diff)
downloadpodman-846d4c2e0139d75d3ff082b9140921dcd657149c.tar.gz
podman-846d4c2e0139d75d3ff082b9140921dcd657149c.tar.bz2
podman-846d4c2e0139d75d3ff082b9140921dcd657149c.zip
Use set for systemd commands
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'pkg/specgen/generate')
-rw-r--r--pkg/specgen/generate/container_create.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index a9eae94af..ec32ab47d 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -164,7 +164,12 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen.
}
if len(command) > 0 {
- if command[0] == "/usr/sbin/init" || command[0] == "/sbin/init" || command[0] == "/usr/local/sbin/init" || (filepath.Base(command[0]) == "systemd") {
+ useSystemdCommands := map[string]bool{
+ "/sbin/init": true,
+ "/usr/sbin/init": true,
+ "/usr/local/sbin/init": true,
+ }
+ if useSystemdCommands[command[0]] || (filepath.Base(command[0]) == "systemd") {
useSystemd = true
}
}