Skip to content

Commit 3842f4d

Browse files
committed
pkg/specgen: Remove deprecated CNINetworks
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent 5d46171 commit 3842f4d

File tree

4 files changed

+3
-35
lines changed

4 files changed

+3
-35
lines changed

pkg/specgen/generate/namespaces.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,19 +338,9 @@ func namespaceOptions(s *specgen.SpecGenerator, rt *libpod.Runtime, pod *libpod.
338338
}
339339
// if no network was specified use add the default
340340
if len(s.Networks) == 0 {
341-
// backwards config still allow the old cni networks list and convert to new format
342-
if len(s.CNINetworks) > 0 {
343-
logrus.Warn(`specgen "cni_networks" option is deprecated use the "networks" map instead`)
344-
networks := make(map[string]types.PerNetworkOptions, len(s.CNINetworks))
345-
for _, net := range s.CNINetworks {
346-
networks[net] = types.PerNetworkOptions{}
347-
}
348-
s.Networks = networks
349-
} else {
350-
// no networks given but bridge is set so use default network
351-
s.Networks = map[string]types.PerNetworkOptions{
352-
rtConfig.Network.DefaultNetwork: {},
353-
}
341+
// no networks given but bridge is set so use default network
342+
s.Networks = map[string]types.PerNetworkOptions{
343+
rtConfig.Network.DefaultNetwork: {},
354344
}
355345
}
356346
// rename the "default" network to the correct default name

pkg/specgen/generate/pod_create.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,6 @@ func MapSpec(p *specgen.PodSpecGenerator) (*specgen.SpecGenerator, error) {
260260
if len(p.Networks) > 0 {
261261
spec.Networks = p.Networks
262262
}
263-
// deprecated cni networks for api users
264-
if len(p.CNINetworks) > 0 {
265-
spec.CNINetworks = p.CNINetworks
266-
}
267263
if p.NoManageHosts {
268264
spec.UseImageHosts = &p.NoManageHosts
269265
}

pkg/specgen/podspecgen.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,6 @@ type PodNetworkConfig struct {
122122
// If the map is empty and the bridge network mode is set the container
123123
// will be joined to the default network.
124124
Networks map[string]types.PerNetworkOptions
125-
// CNINetworks is a list of CNI networks to join the container to.
126-
// If this list is empty, the default CNI network will be joined
127-
// instead. If at least one entry is present, we will not join the
128-
// default network (unless it is part of this list).
129-
// Only available if NetNS is set to bridge.
130-
// Optional.
131-
//
132-
// Deprecated: as of podman 4.0 use "Networks" instead.
133-
CNINetworks []string `json:"cni_networks,omitempty"`
134125
// NoManageResolvConf indicates that /etc/resolv.conf should not be
135126
// managed by the pod. Instead, each container will create and manage a
136127
// separate resolv.conf as if they had not joined a pod.

pkg/specgen/specgen.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -505,15 +505,6 @@ type ContainerNetworkConfig struct {
505505
// will be joined to the default network.
506506
// Optional.
507507
Networks map[string]nettypes.PerNetworkOptions
508-
// CNINetworks is a list of CNI networks to join the container to.
509-
// If this list is empty, the default CNI network will be joined
510-
// instead. If at least one entry is present, we will not join the
511-
// default network (unless it is part of this list).
512-
// Only available if NetNS is set to bridge.
513-
// Optional.
514-
//
515-
// Deprecated: as of podman 4.0 use "Networks" instead.
516-
CNINetworks []string `json:"cni_networks,omitempty"`
517508
// UseImageResolvConf indicates that resolv.conf should not be managed
518509
// by Podman, but instead sourced from the image.
519510
// Conflicts with DNSServer, DNSSearch, DNSOption.

0 commit comments

Comments
 (0)