summaryrefslogtreecommitdiff
path: root/pkg/systemd/generate/pods.go
diff options
context:
space:
mode:
authorBoaz Shuster <boaz.shuster.github@gmail.com>2021-07-29 08:18:58 +0300
committerBoaz Shuster <boaz.shuster.github@gmail.com>2021-10-22 04:19:18 +0300
commitece0c7e5d31a6ae97274a7db80dbabb7564fdc72 (patch)
treed6096edfebd2733238c34f8d5946586c5d7499b6 /pkg/systemd/generate/pods.go
parentc09fab59ddc6964e1c6afc31fa5f1b04c57a2b8c (diff)
downloadpodman-ece0c7e5d31a6ae97274a7db80dbabb7564fdc72.tar.gz
podman-ece0c7e5d31a6ae97274a7db80dbabb7564fdc72.tar.bz2
podman-ece0c7e5d31a6ae97274a7db80dbabb7564fdc72.zip
Support template unit files in podman generate systemd
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
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() {