aboutsummaryrefslogtreecommitdiff
path: root/pkg/varlinkapi
diff options
context:
space:
mode:
authorChristian Heimes <cheimes@redhat.com>2020-08-11 13:29:17 +0200
committerMatthew Heon <matthew.heon@pm.me>2020-08-20 12:16:52 -0400
commit7fb53bc240cea153fb054bcd307d3b1a8945a435 (patch)
tree0ca9c31af6e4718f620ab7f8143dfecf3ad99a79 /pkg/varlinkapi
parent76ae0c907591b60374febdd8bd41f90cbc5444b6 (diff)
downloadpodman-7fb53bc240cea153fb054bcd307d3b1a8945a435.tar.gz
podman-7fb53bc240cea153fb054bcd307d3b1a8945a435.tar.bz2
podman-7fb53bc240cea153fb054bcd307d3b1a8945a435.zip
Use set for systemd commands
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Diffstat (limited to 'pkg/varlinkapi')
-rw-r--r--pkg/varlinkapi/create.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/varlinkapi/create.go b/pkg/varlinkapi/create.go
index 249505486..7661173b8 100644
--- a/pkg/varlinkapi/create.go
+++ b/pkg/varlinkapi/create.go
@@ -704,7 +704,12 @@ func ParseCreateOpts(ctx context.Context, c *GenericCLIResults, runtime *libpod.
if err != nil {
return nil, errors.Wrapf(err, "cannot parse bool %s", c.String("systemd"))
}
- if x && (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 x && (useSystemdCommands[command[0]] || (filepath.Base(command[0]) == "systemd")) {
systemd = true
}
}