aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/common
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-09-15 14:45:55 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-09-16 06:14:35 -0400
commit21841dc381f252d447a00e2d4ca5082a5e80d0f7 (patch)
treec906f734036a8be65503699f1a8a0d1064b24dbd /cmd/podman/common
parent4ba6ee306088a4d322fe28f292bf5d5c4d17b778 (diff)
downloadpodman-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.go18
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") {