summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/pods.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-22 13:44:43 -0500
committerGitHub <noreply@github.com>2021-02-22 13:44:43 -0500
commita6e7d19c463a55a7d3bf6e47faec1906f3f32380 (patch)
tree3d3ef05a6bd448177c737cf0d6ba92ededd84934 /pkg/systemd/generate/pods.go
parentf8ff1727eca1ca726f00f5509fae5d9ca024f516 (diff)
parentd2f3098c6f9068edfe4012387cef2e6d140ef20a (diff)
downloadpodman-a6e7d19c463a55a7d3bf6e47faec1906f3f32380.tar.gz
podman-a6e7d19c463a55a7d3bf6e47faec1906f3f32380.tar.bz2
podman-a6e7d19c463a55a7d3bf6e47faec1906f3f32380.zip
Merge pull request #9445 from jmguzik/no-header-info-for-systemd-generation
No header info for systemd generation
Diffstat (limited to 'pkg/systemd/generate/pods.go')
-rw-r--r--pkg/systemd/generate/pods.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/systemd/generate/pods.go b/pkg/systemd/generate/pods.go
index 343b3c902..8c0401278 100644
--- a/pkg/systemd/generate/pods.go
+++ b/pkg/systemd/generate/pods.go
@@ -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))
}