summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/common.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-06-25 10:13:58 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-06-25 10:13:58 +0200
commit2fed50f4319a9204b5cb86c2924179963f111aae (patch)
tree3700171ef0ff9481fa3bf9c29124ea07fb2d2406 /pkg/systemd/generate/common.go
parent35cca198b31582b75304e3614f8942b83a38422e (diff)
downloadpodman-2fed50f4319a9204b5cb86c2924179963f111aae.tar.gz
podman-2fed50f4319a9204b5cb86c2924179963f111aae.tar.bz2
podman-2fed50f4319a9204b5cb86c2924179963f111aae.zip
generate systemd: improve pod-flags filter
When generating systemd unit for pods, we need to remove certain pod-related flags from the containers' create commands. Make sure to account for all the syntax including a single argument with key and value being split by `=`. Fixes: #6766 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/generate/common.go')
-rw-r--r--pkg/systemd/generate/common.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/systemd/generate/common.go b/pkg/systemd/generate/common.go
index fe56dc874..d6d18a810 100644
--- a/pkg/systemd/generate/common.go
+++ b/pkg/systemd/generate/common.go
@@ -1,6 +1,8 @@
package generate
import (
+ "strings"
+
"github.com/pkg/errors"
)
@@ -44,6 +46,9 @@ func filterPodFlags(command []string) []string {
i++
continue
}
+ if strings.HasPrefix(s, "--pod=") || strings.HasPrefix(s, "--pod-id-file=") {
+ continue
+ }
processed = append(processed, s)
}
return processed