mirror of
https://github.com/containers/podman.git
synced 2025-11-28 17:18:58 +08:00
Remove deprecated fields ctrConfig.[StaticIP,StaticMAC]
Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 ||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user