diff options
author | Christian Heimes <cheimes@redhat.com> | 2020-08-11 13:29:17 +0200 |
---|---|---|
committer | Christian Heimes <cheimes@redhat.com> | 2020-08-11 13:29:17 +0200 |
commit | 846d4c2e0139d75d3ff082b9140921dcd657149c (patch) | |
tree | 35aafc62e70cc57e5b50bc760f17b05f29e01b46 /pkg/varlinkapi | |
parent | 1ae8d2f096e323ad71a8cf8aaf1800d23f29181e (diff) | |
download | podman-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/varlinkapi')
-rw-r--r-- | pkg/varlinkapi/create.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/varlinkapi/create.go b/pkg/varlinkapi/create.go index 2a39477a6..e9309a2d4 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 } } |