diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-09-06 14:49:59 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-09-07 13:58:11 +0200 |
commit | d1573b95e3427efae21da784e3112c5fb3d463fb (patch) | |
tree | da311feeab3105d4577a7d5c4a9a1dc3027603aa /pkg/systemd/generate/common.go | |
parent | e095667ac8c2ccaf06dea6d4c61f51d93b736968 (diff) | |
download | podman-d1573b95e3427efae21da784e3112c5fb3d463fb.tar.gz podman-d1573b95e3427efae21da784e3112c5fb3d463fb.tar.bz2 podman-d1573b95e3427efae21da784e3112c5fb3d463fb.zip |
generate systemd: handle --restart
Handle custom restart policies of containers when generating the unit
files; those should be set on the unit level and removed from ExecStart
flags.
Fixes: #11438
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/generate/common.go')
-rw-r--r-- | pkg/systemd/generate/common.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/systemd/generate/common.go b/pkg/systemd/generate/common.go index 49465fb30..3515bb3b7 100644 --- a/pkg/systemd/generate/common.go +++ b/pkg/systemd/generate/common.go @@ -71,12 +71,13 @@ func filterCommonContainerFlags(command []string, argCount int) []string { case s == "--rm": // Boolean flags support --flag and --flag={true,false}. continue - case s == "--sdnotify", s == "--cgroups", s == "--cidfile": + case s == "--sdnotify", s == "--cgroups", s == "--cidfile", s == "--restart": i++ continue case strings.HasPrefix(s, "--rm="), strings.HasPrefix(s, "--cgroups="), - strings.HasPrefix(s, "--cidfile="): + strings.HasPrefix(s, "--cidfile="), + strings.HasPrefix(s, "--restart="): continue } processed = append(processed, s) |