diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-15 14:45:55 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-09-16 06:14:35 -0400 |
commit | 21841dc381f252d447a00e2d4ca5082a5e80d0f7 (patch) | |
tree | c906f734036a8be65503699f1a8a0d1064b24dbd /cmd/podman/common | |
parent | 4ba6ee306088a4d322fe28f292bf5d5c4d17b778 (diff) | |
download | podman-21841dc381f252d447a00e2d4ca5082a5e80d0f7.tar.gz podman-21841dc381f252d447a00e2d4ca5082a5e80d0f7.tar.bz2 podman-21841dc381f252d447a00e2d4ca5082a5e80d0f7.zip |
Default to --dns-option to match Docker and Buildah
[NO NEW TESTS NEEDED] Existing tests cover this.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd/podman/common')
-rw-r--r-- | cmd/podman/common/netflags.go | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/cmd/podman/common/netflags.go b/cmd/podman/common/netflags.go index 90f05ab15..081914017 100644 --- a/cmd/podman/common/netflags.go +++ b/cmd/podman/common/netflags.go @@ -33,18 +33,12 @@ func DefineNetFlags(cmd *cobra.Command) { ) _ = cmd.RegisterFlagCompletionFunc(dnsFlagName, completion.AutocompleteNone) - dnsOptFlagName := "dns-opt" + dnsOptFlagName := "dns-option" netFlags.StringSlice( dnsOptFlagName, containerConfig.DNSOptions(), "Set custom DNS options", ) _ = cmd.RegisterFlagCompletionFunc(dnsOptFlagName, completion.AutocompleteNone) - netFlags.StringSlice( - "dns-option", containerConfig.DNSOptions(), - "Docker compatibility option== --dns-opt", - ) - _ = netFlags.MarkHidden("dns-option") - dnsSearchFlagName := "dns-search" netFlags.StringSlice( dnsSearchFlagName, containerConfig.DNSSearches(), @@ -143,20 +137,12 @@ func NetFlagsToNetOptions(opts *entities.NetOptions, flags pflag.FlagSet) (*enti } } - if flags.Changed("dns-opt") { - options, err := flags.GetStringSlice("dns-opt") - if err != nil { - return nil, err - } - opts.DNSOptions = options - } - if flags.Changed("dns-option") { options, err := flags.GetStringSlice("dns-option") if err != nil { return nil, err } - opts.DNSOptions = append(opts.DNSOptions, options...) + opts.DNSOptions = options } if flags.Changed("dns-search") { |