diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-04-05 20:54:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-05 20:54:15 +0200 |
commit | e9e4898048fe669263ca16929132ea63edf0ccef (patch) | |
tree | 0447362a63c56c880a850cc6636adf755f7e8ba1 /cmd/podman | |
parent | ca095e435c6b55ef101b1f2b9653214bd18164f6 (diff) | |
parent | c6a21a38b3c799f966e0a0bac2cc740f79526382 (diff) | |
download | podman-e9e4898048fe669263ca16929132ea63edf0ccef.tar.gz podman-e9e4898048fe669263ca16929132ea63edf0ccef.tar.bz2 podman-e9e4898048fe669263ca16929132ea63edf0ccef.zip |
Merge pull request #9907 from rhatdan/options
Add support for podman --context default
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/root.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 2b77afbeb..4527c2646 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -180,6 +180,10 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error { os.Setenv("TMPDIR", "/var/tmp") } + context := cmd.Root().LocalFlags().Lookup("context") + if context.Value.String() != "default" { + return errors.New("Podman does not support swarm, the only --context value allowed is \"default\"") + } if !registry.IsRemote() { if cmd.Flag("cpu-profile").Changed { f, err := os.Create(cfg.CPUProfile) @@ -269,6 +273,10 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) { lFlags.StringVar(&opts.URI, urlFlagName, uri, "URL to access Podman service (CONTAINER_HOST)") _ = cmd.RegisterFlagCompletionFunc(urlFlagName, completion.AutocompleteDefault) + // 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") + identityFlagName := "identity" lFlags.StringVar(&opts.Identity, identityFlagName, ident, "path to SSH identity file, (CONTAINER_SSHKEY)") _ = cmd.RegisterFlagCompletionFunc(identityFlagName, completion.AutocompleteDefault) |