From 1994f382320e627a91e9c510d868c81dd17866bb Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 6 Sep 2022 14:24:34 -0400 Subject: Add --config for Docker compatibility Fixes: https://github.com/containers/podman/issues/14767 Signed-off-by: Daniel J Walsh --- cmd/podman/root.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'cmd/podman') diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 0261cd670..2e00777a4 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -73,6 +73,7 @@ var ( defaultLogLevel = "warn" logLevel = defaultLogLevel + dockerConfig = "" debug bool useSyslog bool @@ -85,6 +86,7 @@ func init() { loggingHook, syslogHook, earlyInitHook, + configHook, ) rootFlags(rootCmd, registry.PodmanConfig()) @@ -311,6 +313,12 @@ func persistentPostRunE(cmd *cobra.Command, args []string) error { return nil } +func configHook() { + if dockerConfig != "" { + logrus.Warn("The --config flag is ignored by Podman. Exists for Docker compatibility") + } +} + func loggingHook() { var found bool if debug { @@ -363,6 +371,8 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) { lFlags.StringVarP(&opts.URI, "host", "H", uri, "Used for Docker compatibility") _ = lFlags.MarkHidden("host") + lFlags.StringVar(&dockerConfig, "config", "", "Ignored for Docker compatibility") + _ = lFlags.MarkHidden("config") // Context option added just for compatibility with DockerCLI. lFlags.String("context", "default", "Name of the context to use to connect to the daemon (This flag is a NOOP and provided solely for scripting compatibility.)") _ = lFlags.MarkHidden("context") -- cgit v1.2.3-54-g00ecf