From 319c85e89ee2ee565da12680cca041335296a0c0 Mon Sep 17 00:00:00 2001 From: Shivkumar13 Date: Wed, 11 Aug 2021 22:57:25 +0530 Subject: Support for --tls-verify flag in podman run & podman create Signed-off-by: Shivkumar13 --- cmd/podman/common/create.go | 9 +++++++++ cmd/podman/common/create_opts.go | 1 + 2 files changed, 10 insertions(+) (limited to 'cmd/podman/common') diff --git a/cmd/podman/common/create.go b/cmd/podman/common/create.go index 602ad5d94..401cf2e09 100644 --- a/cmd/podman/common/create.go +++ b/cmd/podman/common/create.go @@ -544,6 +544,15 @@ func DefineCreateFlags(cmd *cobra.Command, cf *ContainerCLIOpts) { ) _ = cmd.RegisterFlagCompletionFunc(podIDFileFlagName, completion.AutocompleteDefault) + // Flag for TLS verification, so that `run` and `create` commands can make use of it. + // Make sure to use `=` while using this flag i.e `--tls-verify=false/true` + tlsVerifyFlagName := "tls-verify" + createFlags.BoolVar( + &cf.TLSVerify, + tlsVerifyFlagName, true, + "Require HTTPS and verify certificates when contacting registries for pulling images", + ) + createFlags.BoolVar( &cf.Privileged, "privileged", false, diff --git a/cmd/podman/common/create_opts.go b/cmd/podman/common/create_opts.go index 0a969bfd2..3b39e39ea 100644 --- a/cmd/podman/common/create_opts.go +++ b/cmd/podman/common/create_opts.go @@ -112,6 +112,7 @@ type ContainerCLIOpts struct { Sysctl []string Systemd string Timeout uint + TLSVerify bool TmpFS []string TTY bool Timezone string -- cgit v1.2.3-54-g00ecf