diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2020-06-05 18:23:12 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-06-11 11:01:13 +0200 |
commit | 8d8746adeeab8a39ccedb5b06fe8d0a785a97190 (patch) | |
tree | afa9891205369f8d36043ad6236939720c012a2a /pkg/systemd/generate/common.go | |
parent | 35ae53067f01c0194dc13513656e57293de95004 (diff) | |
download | podman-8d8746adeeab8a39ccedb5b06fe8d0a785a97190.tar.gz podman-8d8746adeeab8a39ccedb5b06fe8d0a785a97190.tar.bz2 podman-8d8746adeeab8a39ccedb5b06fe8d0a785a97190.zip |
generate systemd: create pod template
Create a new template for generating a pod unit file. Eventually, this
allows for treating and extending pod and container generation
seprately.
The `--new` flag now also works on pods.
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/generate/common.go')
-rw-r--r-- | pkg/systemd/generate/common.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/systemd/generate/common.go b/pkg/systemd/generate/common.go index e809b4837..4f995be96 100644 --- a/pkg/systemd/generate/common.go +++ b/pkg/systemd/generate/common.go @@ -34,3 +34,17 @@ Documentation=man:podman-generate-systemd(1) Wants=network.target After=network-online.target ` + +// filterPodFlags removes --pod and --pod-id-file from the specified command. +func filterPodFlags(command []string) []string { + processed := []string{} + for i := 0; i < len(command); i++ { + s := command[i] + if s == "--pod" || s == "--pod-id-file" { + i += 1 + continue + } + processed = append(processed, s) + } + return processed +} |