summaryrefslogtreecommitdiff
path: root/libpod/container_validate.go
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-12-07 23:04:47 +0100
committerPaul Holzinger <pholzing@redhat.com>2021-12-14 15:23:39 +0100
commit9ce6b64133bc37433efac391bcaf9234c3890fc5 (patch)
tree92f8be84f1799230083d3490b52956ce2c01f4f1 /libpod/container_validate.go
parent4e8ad039cee5debcc1afe93a455cd8a25e88d16b (diff)
downloadpodman-9ce6b64133bc37433efac391bcaf9234c3890fc5.tar.gz
podman-9ce6b64133bc37433efac391bcaf9234c3890fc5.tar.bz2
podman-9ce6b64133bc37433efac391bcaf9234c3890fc5.zip
network db: add new strucutre to container create
Make sure we create new containers in the db with the correct structure. Also remove some unneeded code for alias handling. We no longer need this functions. The specgen format has not been changed for now. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/container_validate.go')
-rw-r--r--libpod/container_validate.go13
1 files changed, 1 insertions, 12 deletions
diff --git a/libpod/container_validate.go b/libpod/container_validate.go
index 91ebe93fb..ca5ce8b2a 100644
--- a/libpod/container_validate.go
+++ b/libpod/container_validate.go
@@ -74,7 +74,7 @@ func (c *Container) validate() error {
// Cannot set static IP or MAC if joining >1 CNI network.
if len(c.config.Networks) > 1 && (c.config.StaticIP != nil || c.config.StaticMAC != nil) {
- return errors.Wrapf(define.ErrInvalidArg, "cannot set static IP or MAC address if joining more than one CNI network")
+ return errors.Wrapf(define.ErrInvalidArg, "cannot set static IP or MAC address if joining more than one network")
}
// Using image resolv.conf conflicts with various DNS settings.
@@ -115,17 +115,6 @@ func (c *Container) validate() error {
destinations[vol.Dest] = true
}
- // Check that networks and network aliases match up.
- ctrNets := make(map[string]bool)
- for _, net := range c.config.Networks {
- ctrNets[net] = true
- }
- for net := range c.config.NetworkAliases {
- if _, ok := ctrNets[net]; !ok {
- return errors.Wrapf(define.ErrNoSuchNetwork, "container tried to set network aliases for network %s but is not connected to the network", net)
- }
- }
-
// If User in the OCI spec is set, require that c.config.User is set for
// security reasons (a lot of our code relies on c.config.User).
if c.config.User == "" && (c.config.Spec.Process.User.UID != 0 || c.config.Spec.Process.User.GID != 0) {