mirror of
https://github.com/containers/podman.git
synced 2025-07-15 03:02:52 +08:00
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>
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user