aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-09 15:17:19 +0200
committerGitHub <noreply@github.com>2022-09-09 15:17:19 +0200
commit7e7db23dbf163837ba3216fea09b31d2c8409fb3 (patch)
treeae14de85a086738fa1bcdb24b06506bea72b4f7b /cmd
parentb239966d11cd7b5f7d8c84190c579afc093bc3bf (diff)
parentaad29e759c78b415a3b0393d7aba2bddbbc0cd3e (diff)
downloadpodman-7e7db23dbf163837ba3216fea09b31d2c8409fb3.tar.gz
podman-7e7db23dbf163837ba3216fea09b31d2c8409fb3.tar.bz2
podman-7e7db23dbf163837ba3216fea09b31d2c8409fb3.zip
Merge pull request #15687 from vrothberg/RUN-1639
health check: add on-failure actions
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common/completion.go5
-rw-r--r--cmd/podman/common/create.go8
2 files changed, 13 insertions, 0 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go
index b3a816aa4..60d056aaa 100644
--- a/cmd/podman/common/completion.go
+++ b/cmd/podman/common/completion.go
@@ -1641,3 +1641,8 @@ func AutocompleteSSH(cmd *cobra.Command, args []string, toComplete string) ([]st
}
return []string{string(ssh.GolangMode), string(ssh.NativeMode)}, cobra.ShellCompDirectiveNoFileComp
}
+
+// AutocompleteHealthOnFailure - action to take once the container turns unhealthy.
+func AutocompleteHealthOnFailure(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
+ return define.SupportedHealthCheckOnFailureActions, cobra.ShellCompDirectiveNoFileComp
+}
diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go
index a2bc45b9e..8fff03773 100644
--- a/cmd/podman/common/create.go
+++ b/cmd/podman/common/create.go
@@ -208,6 +208,14 @@ func DefineCreateFlags(cmd *cobra.Command, cf *entities.ContainerCreateOptions,
)
_ = cmd.RegisterFlagCompletionFunc(healthTimeoutFlagName, completion.AutocompleteNone)
+ healthOnFailureFlagName := "health-on-failure"
+ createFlags.StringVar(
+ &cf.HealthOnFailure,
+ healthOnFailureFlagName, "none",
+ "action to take once the container turns unhealthy",
+ )
+ _ = cmd.RegisterFlagCompletionFunc(healthOnFailureFlagName, AutocompleteHealthOnFailure)
+
createFlags.BoolVar(
&cf.HTTPProxy,
"http-proxy", containerConfig.Containers.HTTPProxy,