summaryrefslogtreecommitdiff
path: root/cmd/podman/utils.go
diff options
context:
space:
mode:
authorHunor Csomortáni <csomh@redhat.com>2019-07-04 14:24:09 +0200
committerHunor Csomortáni <csomh@redhat.com>2019-07-16 06:15:28 +0200
commit3e53bfe36e385f6d85b10d1eadab0a249f580f97 (patch)
tree290cb9b711e1a4e72556f25adc277bc13f1555c7 /cmd/podman/utils.go
parent51c00eae8b22356e72c84601e8c4f88b739755c7 (diff)
downloadpodman-3e53bfe36e385f6d85b10d1eadab0a249f580f97.tar.gz
podman-3e53bfe36e385f6d85b10d1eadab0a249f580f97.tar.bz2
podman-3e53bfe36e385f6d85b10d1eadab0a249f580f97.zip
Make the healthcheck flags compatible with Docker CLI
Docker CLI calls the healthcheck flags "--health-*", instead of "--healthcheck-*". Introduce the former, in order to keep compatibility, and alias the later, in order to avoid breaking current usage. Change "--healthcheck-*" to "--health-*" in the docs and tests. Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
Diffstat (limited to 'cmd/podman/utils.go')
-rw-r--r--cmd/podman/utils.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/cmd/podman/utils.go b/cmd/podman/utils.go
index 0790f673a..c0ddaba4e 100644
--- a/cmd/podman/utils.go
+++ b/cmd/podman/utils.go
@@ -47,3 +47,19 @@ func markFlagHidden(flags *pflag.FlagSet, flag string) {
logrus.Errorf("unable to mark flag '%s' as hidden: %q", flag, err)
}
}
+
+func aliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
+ switch name {
+ case "healthcheck-command":
+ name = "health-cmd"
+ case "healthcheck-interval":
+ name = "health-interval"
+ case "healthcheck-retries":
+ name = "health-retries"
+ case "healthcheck-start-period":
+ name = "health-start-period"
+ case "healthcheck-timeout":
+ name = "health-timeout"
+ }
+ return pflag.NormalizedName(name)
+}