diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-02-22 13:44:43 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-22 13:44:43 -0500 |
commit | a6e7d19c463a55a7d3bf6e47faec1906f3f32380 (patch) | |
tree | 3d3ef05a6bd448177c737cf0d6ba92ededd84934 /pkg/systemd/generate/containers.go | |
parent | f8ff1727eca1ca726f00f5509fae5d9ca024f516 (diff) | |
parent | d2f3098c6f9068edfe4012387cef2e6d140ef20a (diff) | |
download | podman-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/containers.go')
-rw-r--r-- | pkg/systemd/generate/containers.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/systemd/generate/containers.go b/pkg/systemd/generate/containers.go index 4fb437d08..92c6d8865 100644 --- a/pkg/systemd/generate/containers.go +++ b/pkg/systemd/generate/containers.go @@ -65,7 +65,8 @@ type containerInfo struct { ExecStop string // ExecStopPost of the unit. ExecStopPost string - + // Removes autogenerated by Podman and timestamp if set to true + GenerateNoHeader bool // If not nil, the container is part of the pod. We can use the // podInfo to extract the relevant data. Pod *podInfo @@ -292,10 +293,15 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst 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)) } - // Sort the slices to assure a deterministic output. sort.Strings(info.BoundToServices) |