diff --git a/libpod/container_config.go b/libpod/container_config.go index 2eb0eb3dec..acccb21af0 100644 --- a/libpod/container_config.go +++ b/libpod/container_config.go @@ -250,18 +250,6 @@ type ContainerNetworkConfig struct { // network namespace for the container. // This cannot be set if NetNsCtr is also set. CreateNetNS bool `json:"createNetNS"` - // StaticIP is a static IP to request for the container. - // This cannot be set unless CreateNetNS is set. - // If not set, the container will be dynamically assigned an IP by CNI. - // - // Deprecated: Do no use this anymore, this is only for DB backwards compat. - StaticIP net.IP `json:"staticIP,omitempty"` - // StaticMAC is a static MAC to request for the container. - // This cannot be set unless CreateNetNS is set. - // If not set, the container will be dynamically assigned a MAC by CNI. - // - // Deprecated: Do no use this anymore, this is only for DB backwards compat. - StaticMAC types.HardwareAddr `json:"staticMAC,omitempty"` // PortMappings are the ports forwarded to the container's network // namespace // These are not used unless CreateNetNS is true diff --git a/libpod/container_validate.go b/libpod/container_validate.go index 6d812b5321..01ec586b8b 100644 --- a/libpod/container_validate.go +++ b/libpod/container_validate.go @@ -80,16 +80,6 @@ func (c *Container) validate() error { } } - // Can only set static IP or MAC is creating a network namespace. - if !c.config.CreateNetNS && (c.config.StaticIP != nil || c.config.StaticMAC != nil) { - return fmt.Errorf("cannot set static IP or MAC address if not creating a network namespace: %w", define.ErrInvalidArg) - } - - // Cannot set static IP or MAC if joining >1 network. - if len(c.config.Networks) > 1 && (c.config.StaticIP != nil || c.config.StaticMAC != nil) { - return fmt.Errorf("cannot set static IP or MAC address if joining more than one network: %w", define.ErrInvalidArg) - } - // Using image resolv.conf conflicts with various DNS settings. if c.config.UseImageResolvConf && (len(c.config.DNSSearch) > 0 || len(c.config.DNSServer) > 0 || diff --git a/libpod/pod_api.go b/libpod/pod_api.go index 5fa533526f..c4b609d7ab 100644 --- a/libpod/pod_api.go +++ b/libpod/pod_api.go @@ -667,7 +667,6 @@ func (p *Pod) Inspect() (*define.InspectPodData, error) { } infraConfig = new(define.InspectPodInfraConfig) infraConfig.HostNetwork = p.NetworkMode() == "host" - infraConfig.StaticIP = infra.config.ContainerNetworkConfig.StaticIP infraConfig.NoManageResolvConf = infra.config.UseImageResolvConf infraConfig.NoManageHostname = infra.config.UseImageHostname infraConfig.NoManageHosts = infra.config.UseImageHosts diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 3f0c0958a7..b8f588a802 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -205,11 +205,6 @@ func (r *Runtime) initContainerVariables(rSpec *spec.Spec, config *ContainerConf } // Reset the log path to point to the default ctr.config.LogPath = "" - // Later in validate() the check is for nil. JSONDeepCopy sets it to an empty - // object. Resetting it to nil if it was nil before. - if config.StaticMAC == nil { - ctr.config.StaticMAC = nil - } } ctr.config.Spec = rSpec diff --git a/pkg/checkpoint/checkpoint_restore.go b/pkg/checkpoint/checkpoint_restore.go index 98493c465d..9680cdb8b6 100644 --- a/pkg/checkpoint/checkpoint_restore.go +++ b/pkg/checkpoint/checkpoint_restore.go @@ -139,8 +139,6 @@ func CRImportCheckpoint(ctx context.Context, runtime *libpod.Runtime, restoreOpt opts.StaticMAC = nil ctrConfig.Networks[net] = opts } - ctrConfig.StaticIP = nil - ctrConfig.StaticMAC = nil } if ctrConfig.PIDNsCtr != "" {