summaryrefslogtreecommitdiff
path: root/pkg/specgen/pod_validate.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-13 20:36:25 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-12-14 15:23:40 +0100
commitef325bc8c4824537e4bfb21aa7e6114a6e5a8c09 (patch)
tree9c74760b6d93f83534e8f0deb400f0af2c579474 /pkg/specgen/pod_validate.go
parent094e1d70dee1f5cc04987169615898bd6a4af499 (diff)
downloadpodman-ef325bc8c4824537e4bfb21aa7e6114a6e5a8c09.tar.gz
podman-ef325bc8c4824537e4bfb21aa7e6114a6e5a8c09.tar.bz2
podman-ef325bc8c4824537e4bfb21aa7e6114a6e5a8c09.zip
specgen: check that networks are only set with bridge
Because we cannot reqad the networking mode in the frontent because we should always use the server default we have to parse the mac and ip address to the server via a default network. Now when the server reads the default nsmode it has to reject the provided networks when the mode is not set to bridge. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/specgen/pod_validate.go')
-rw-r--r--pkg/specgen/pod_validate.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go
index 224a5b12d..c5a66189c 100644
--- a/pkg/specgen/pod_validate.go
+++ b/pkg/specgen/pod_validate.go
@@ -67,10 +67,8 @@ func (p *PodSpecGenerator) Validate() error {
if len(p.PortMappings) > 0 {
return errors.New("PortMappings can only be used with Bridge or slirp4netns networking")
}
- if len(p.Networks) > 0 {
- return errors.New("Networks can only be used with Bridge mode networking")
- }
}
+
if p.NoManageResolvConf {
if len(p.DNSServer) > 0 {
return exclusivePodOptions("NoManageResolvConf", "DNSServer")