summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-19 20:29:01 -0500
committerGitHub <noreply@github.com>2022-01-19 20:29:01 -0500
commit7fc8bf4a428c08fcb9c9e97d238628319a20986e (patch)
treeddcd1faacca37f72bafc6f3bc77c55f3829eb387 /cmd/podman
parent6b59b10248b0bd92127dfc455ca40579d4c396a0 (diff)
parentb9a2d8698a22c4b267e252caad56d8b31fcadd38 (diff)
downloadpodman-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 'cmd/podman')
-rw-r--r--cmd/podman/generate/systemd.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmd/podman/generate/systemd.go b/cmd/podman/generate/systemd.go
index 5ad42ebc0..0dab6299d 100644
--- a/cmd/podman/generate/systemd.go
+++ b/cmd/podman/generate/systemd.go
@@ -25,6 +25,9 @@ const (
restartPolicyFlagName = "restart-policy"
restartSecFlagName = "restart-sec"
newFlagName = "new"
+ wantsFlagName = "wants"
+ afterFlagName = "after"
+ requiresFlagName = "requires"
)
var (
@@ -97,6 +100,15 @@ func init() {
flags.StringVar(&format, formatFlagName, "", "Print the created units in specified format (json)")
_ = systemdCmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(nil))
+ flags.StringArrayVar(&systemdOptions.Wants, wantsFlagName, nil, "Add (weak) requirement dependencies to the generated unit file")
+ _ = systemdCmd.RegisterFlagCompletionFunc(wantsFlagName, completion.AutocompleteNone)
+
+ flags.StringArrayVar(&systemdOptions.After, afterFlagName, nil, "Add dependencies order to the generated unit file")
+ _ = systemdCmd.RegisterFlagCompletionFunc(afterFlagName, completion.AutocompleteNone)
+
+ flags.StringArrayVar(&systemdOptions.Requires, requiresFlagName, nil, "Similar to wants, but declares stronger requirement dependencies")
+ _ = systemdCmd.RegisterFlagCompletionFunc(requiresFlagName, completion.AutocompleteNone)
+
flags.SetNormalizeFunc(utils.TimeoutAliasFlags)
}