diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-19 20:29:01 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 20:29:01 -0500 |
commit | 7fc8bf4a428c08fcb9c9e97d238628319a20986e (patch) | |
tree | ddcd1faacca37f72bafc6f3bc77c55f3829eb387 /pkg/domain | |
parent | 6b59b10248b0bd92127dfc455ca40579d4c396a0 (diff) | |
parent | b9a2d8698a22c4b267e252caad56d8b31fcadd38 (diff) | |
download | podman-7fc8bf4a428c08fcb9c9e97d238628319a20986e.tar.gz podman-7fc8bf4a428c08fcb9c9e97d238628319a20986e.tar.bz2 podman-7fc8bf4a428c08fcb9c9e97d238628319a20986e.zip |
Merge pull request #12887 from esendjer/main
Add custom defined dependencies to podman generate systemd
Diffstat (limited to 'pkg/domain')
-rw-r--r-- | pkg/domain/entities/generate.go | 6 | ||||
-rw-r--r-- | pkg/domain/infra/tunnel/generate.go | 12 |
2 files changed, 17 insertions, 1 deletions
diff --git a/pkg/domain/entities/generate.go b/pkg/domain/entities/generate.go index e431a70af..73dd64ecd 100644 --- a/pkg/domain/entities/generate.go +++ b/pkg/domain/entities/generate.go @@ -26,6 +26,12 @@ type GenerateSystemdOptions struct { NoHeader bool // TemplateUnitFile - make use of %i and %I to differentiate between the different instances of the unit TemplateUnitFile bool + // Wants - systemd wants list for the container or pods + Wants []string + // After - systemd after list for the container or pods + After []string + // Requires - systemd requires list for the container or pods + Requires []string } // GenerateSystemdReport diff --git a/pkg/domain/infra/tunnel/generate.go b/pkg/domain/infra/tunnel/generate.go index 49b66e908..235d478ec 100644 --- a/pkg/domain/infra/tunnel/generate.go +++ b/pkg/domain/infra/tunnel/generate.go @@ -8,7 +8,17 @@ import ( ) func (ic *ContainerEngine) GenerateSystemd(ctx context.Context, nameOrID string, opts entities.GenerateSystemdOptions) (*entities.GenerateSystemdReport, error) { - options := new(generate.SystemdOptions).WithUseName(opts.Name).WithContainerPrefix(opts.ContainerPrefix).WithNew(opts.New).WithNoHeader(opts.NoHeader).WithTemplateUnitFile(opts.TemplateUnitFile).WithPodPrefix(opts.PodPrefix).WithSeparator(opts.Separator) + options := new( + generate.SystemdOptions). + WithUseName(opts.Name). + WithContainerPrefix(opts.ContainerPrefix). + WithNew(opts.New).WithNoHeader(opts.NoHeader). + WithTemplateUnitFile(opts.TemplateUnitFile). + WithPodPrefix(opts.PodPrefix). + WithSeparator(opts.Separator). + WithWants(opts.Wants). + WithAfter(opts.After). + WithRequires(opts.Requires) if opts.StartTimeout != nil { options.WithStartTimeout(*opts.StartTimeout) |