diff options
Diffstat (limited to 'pkg/systemd/generate/pods.go')
-rw-r--r-- | pkg/systemd/generate/pods.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pkg/systemd/generate/pods.go b/pkg/systemd/generate/pods.go index ff8ce3a03..8c0401278 100644 --- a/pkg/systemd/generate/pods.go +++ b/pkg/systemd/generate/pods.go @@ -9,9 +9,9 @@ import ( "text/template" "time" - "github.com/containers/podman/v2/libpod" - "github.com/containers/podman/v2/pkg/domain/entities" - "github.com/containers/podman/v2/version" + "github.com/containers/podman/v3/libpod" + "github.com/containers/podman/v3/pkg/domain/entities" + "github.com/containers/podman/v3/version" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/pflag" @@ -70,6 +70,8 @@ type podInfo struct { ExecStop string // ExecStopPost of the unit. ExecStopPost string + // Removes autogenerated by Podman and timestamp if set to true + GenerateNoHeader bool } const podTemplate = headerTemplate + `Requires={{{{- range $index, $value := .RequiredServices -}}}}{{{{if $index}}}} {{{{end}}}}{{{{ $value }}}}.service{{{{end}}}} @@ -319,6 +321,12 @@ func executePodTemplate(info *podInfo, options entities.GenerateSystemdOptions) if info.PodmanVersion == "" { info.PodmanVersion = version.Version.String() } + + if options.NoHeader { + info.GenerateNoHeader = true + info.GenerateTimestamp = false + } + if info.GenerateTimestamp { info.TimeStamp = fmt.Sprintf("%v", time.Now().Format(time.UnixDate)) } |