summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/pods.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-15 16:30:38 +0100
committerGitHub <noreply@github.com>2021-11-15 16:30:38 +0100
commite9d8ca22b8ea5923d6188225cd2d2254bdc4d898 (patch)
treedbb04a3758c48fbaf3289d624e3fe84518133206 /pkg/systemd/generate/pods.go
parentd40736fef1c0cbfc57ed39678bf95c016a13b512 (diff)
parent73e1cdfe9e41a8748b75b9461c087e4cee5d2183 (diff)
downloadpodman-e9d8ca22b8ea5923d6188225cd2d2254bdc4d898.tar.gz
podman-e9d8ca22b8ea5923d6188225cd2d2254bdc4d898.tar.bz2
podman-e9d8ca22b8ea5923d6188225cd2d2254bdc4d898.zip
Merge pull request #11076 from boaz0/closes_10275
Support template unit files in podman generate systemd
Diffstat (limited to 'pkg/systemd/generate/pods.go')
-rw-r--r--pkg/systemd/generate/pods.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/systemd/generate/pods.go b/pkg/systemd/generate/pods.go
index e755b8eea..38f7e8e3e 100644
--- a/pkg/systemd/generate/pods.go
+++ b/pkg/systemd/generate/pods.go
@@ -79,6 +79,8 @@ type podInfo struct {
// Location of the RunRoot for the pod. Required for ensuring the tmpfs
// or volume exists and is mounted when coming online at boot.
RunRoot string
+ // Add %i and %I to description and execute parts - this should not be used
+ IdentifySpecifier bool
}
const podTemplate = headerTemplate + `Requires={{{{- range $index, $value := .RequiredServices -}}}}{{{{if $index}}}} {{{{end}}}}{{{{ $value }}}}.service{{{{end}}}}
@@ -108,6 +110,9 @@ WantedBy=multi-user.target default.target
// Based on the options, the return value might be the content of all units or
// the files they been written to.
func PodUnits(pod *libpod.Pod, options entities.GenerateSystemdOptions) (map[string]string, error) {
+ if options.TemplateUnitFile {
+ return nil, errors.New("--template is not supported for pods")
+ }
// Error out if the pod has no infra container, which we require to be the
// main service.
if !pod.HasInfraContainer() {