summaryrefslogtreecommitdiff
path: root/pkg/domain/entities
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-04-18 08:49:46 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-04-19 05:19:30 -0400
commit426eccee63fc7add4b37a9c246cf83b08379cb62 (patch)
treec28ece34d0b01c4f85aebc7cab63c1a21a7e9472 /pkg/domain/entities
parente4e42b28dfef0ffd12f2087048dec61f9cb03976 (diff)
downloadpodman-426eccee63fc7add4b37a9c246cf83b08379cb62.tar.gz
podman-426eccee63fc7add4b37a9c246cf83b08379cb62.tar.bz2
podman-426eccee63fc7add4b37a9c246cf83b08379cb62.zip
Cleanup network option parsing
We were not handling the parsing of --ip. This pr adds validation checks and now will support the flag. Move validation to the actual parsing of the network flags. We should only parse the dns flags if the user changed them. We don't want to pass default options if set in containers.conf to the server. Potential for duplicating defaults. Add support for --dns-opt flag passing Begin handling of --network flag, although we don't have a way right now to translate a string into a specgen.Namespace. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain/entities')
-rw-r--r--pkg/domain/entities/pods.go2
-rw-r--r--pkg/domain/entities/types.go22
2 files changed, 12 insertions, 12 deletions
diff --git a/pkg/domain/entities/pods.go b/pkg/domain/entities/pods.go
index 04673ef18..aa1445a6a 100644
--- a/pkg/domain/entities/pods.go
+++ b/pkg/domain/entities/pods.go
@@ -134,7 +134,7 @@ func (p PodCreateOptions) ToPodSpecGen(s *specgen.PodSpecGenerator) {
s.StaticMAC = p.Net.StaticMAC
s.PortMappings = p.Net.PublishPorts
s.CNINetworks = p.Net.CNINetworks
- if p.Net.DNSHost {
+ if p.Net.UseImageResolvConf {
s.NoManageResolvConf = true
}
s.DNSServer = p.Net.DNSServers
diff --git a/pkg/domain/entities/types.go b/pkg/domain/entities/types.go
index b89aa869a..d0a7c66ce 100644
--- a/pkg/domain/entities/types.go
+++ b/pkg/domain/entities/types.go
@@ -32,17 +32,17 @@ type VolumeDeleteReport struct{ Report }
// NetOptions reflect the shared network options between
// pods and containers
type NetOptions struct {
- AddHosts []string
- CNINetworks []string
- DNSHost bool
- DNSOptions []string
- DNSSearch []string
- DNSServers []net.IP
- Network specgen.Namespace
- NoHosts bool
- PublishPorts []ocicni.PortMapping
- StaticIP *net.IP
- StaticMAC *net.HardwareAddr
+ AddHosts []string
+ CNINetworks []string
+ UseImageResolvConf bool
+ DNSOptions []string
+ DNSSearch []string
+ DNSServers []net.IP
+ Network specgen.Namespace
+ NoHosts bool
+ PublishPorts []ocicni.PortMapping
+ StaticIP *net.IP
+ StaticMAC *net.HardwareAddr
}
// All CLI inspect commands and inspect sub-commands use the same options