Skip to content

Commit 86f992f

Browse files
committed
common/pkg/config: remove slirp
Signed-off-by: Lokesh Mandvekar <[email protected]>
1 parent bbe02b4 commit 86f992f

File tree

6 files changed

+9
-76
lines changed

6 files changed

+9
-76
lines changed

common/pkg/config/config.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,6 @@ type EngineConfig struct {
403403
// containers and pods will be visible. The default namespace is "".
404404
Namespace string `toml:"namespace,omitempty"`
405405

406-
// NetworkCmdPath is the path to the slirp4netns binary.
407-
NetworkCmdPath string `toml:"network_cmd_path,omitempty"`
408-
409-
// NetworkCmdOptions is the default options to pass to the slirp4netns binary.
410-
// For example "allow_host_loopback=true"
411-
NetworkCmdOptions attributedstring.Slice `toml:"network_cmd_options,omitempty"`
412-
413406
// NoPivotRoot sets whether to set no-pivot-root in the OCI runtime.
414407
NoPivotRoot bool `toml:"no_pivot_root,omitempty"`
415408

@@ -620,7 +613,7 @@ type NetworkConfig struct {
620613
DefaultSubnetPools []SubnetPool `toml:"default_subnet_pools,omitempty"`
621614

622615
// DefaultRootlessNetworkCmd is used to set the default rootless network
623-
// program, either "slirp4nents" (default) or "pasta".
616+
// program, currently only "pasta".
624617
DefaultRootlessNetworkCmd string `toml:"default_rootless_network_cmd,omitempty"`
625618

626619
// NetworkConfigDir is where network configuration files are stored.

common/pkg/config/config_local_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,6 @@ var _ = Describe("Config Local", func() {
147147
config, err := newLocked(&Options{}, &paths{})
148148
gomega.Expect(err).ToNot(gomega.HaveOccurred())
149149
gomega.Expect(config.Network.DefaultRootlessNetworkCmd).To(gomega.Equal("pasta"))
150-
// When
151-
config2, err := newLocked(&Options{}, &paths{etc: "testdata/containers_default.conf"})
152-
// Then
153-
gomega.Expect(err).ToNot(gomega.HaveOccurred())
154-
gomega.Expect(config2.Network.DefaultRootlessNetworkCmd).To(gomega.Equal("slirp4netns"))
155150
})
156151

157152
It("should fail on invalid device mode", func() {

common/pkg/config/config_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ image_copy_tmp_dir="storage"`
328328
gomega.Expect(defaultConfig.Engine.OCIRuntimes).To(gomega.Equal(OCIRuntimeMap))
329329
gomega.Expect(defaultConfig.Engine.PlatformToOCIRuntime).To(gomega.Equal(PlatformToOCIRuntimeMap))
330330
gomega.Expect(defaultConfig.Containers.HTTPProxy).To(gomega.BeFalse())
331-
gomega.Expect(defaultConfig.Engine.NetworkCmdOptions.Get()).To(gomega.BeEmpty())
332331
gomega.Expect(defaultConfig.Engine.HelperBinariesDir.Get()).To(gomega.Equal(helperDirs))
333332
gomega.Expect(defaultConfig.Engine.ServiceTimeout).To(gomega.BeEquivalentTo(300))
334333
gomega.Expect(defaultConfig.Engine.InfraImage).To(gomega.BeEquivalentTo("registry.k8s.io/pause:3.4.1"))

common/pkg/config/containers.conf

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ default_sysctls = [
216216
#
217217
#log_driver = "k8s-file"
218218

219-
# Default path for container logs to be stored in. When empty, logs will be stored
219+
# Default path for container logs to be stored in. When empty, logs will be stored
220220
# in the container's default storage and removed when the container is removed.
221-
# A subdirectory named with the container ID will be created under the specified
221+
# A subdirectory named with the container ID will be created under the specified
222222
# path, and the log file will have the default name `ctr.log` within that directory.
223223
# This option can be overridden by the `--log-opt` flag.
224-
#
224+
#
225225
#log_path = ""
226226

227227
# Maximum size allowed for the container log file. Negative numbers indicate
@@ -420,8 +420,8 @@ default_sysctls = [
420420

421421

422422

423-
# Configure which rootless network program to use by default. Valid options are
424-
# `slirp4netns` and `pasta` (default).
423+
# Configure which rootless network program to use by default. Only current valid option is
424+
# `pasta` (default).
425425
#
426426
#default_rootless_network_cmd = "pasta"
427427

@@ -666,32 +666,6 @@ default_sysctls = [
666666
#
667667
#namespace = ""
668668

669-
# Path to the slirp4netns binary
670-
#
671-
#network_cmd_path = ""
672-
673-
# Default options to pass to the slirp4netns binary.
674-
# Valid options values are:
675-
#
676-
# - allow_host_loopback=true|false: Allow the slirp4netns to reach the host loopback IP (`10.0.2.2`).
677-
# Default is false.
678-
# - mtu=MTU: Specify the MTU to use for this network. (Default is `65520`).
679-
# - cidr=CIDR: Specify ip range to use for this network. (Default is `10.0.2.0/24`).
680-
# - enable_ipv6=true|false: Enable IPv6. Default is true. (Required for `outbound_addr6`).
681-
# - outbound_addr=INTERFACE: Specify the outbound interface slirp should bind to (ipv4 traffic only).
682-
# - outbound_addr=IPv4: Specify the outbound ipv4 address slirp should bind to.
683-
# - outbound_addr6=INTERFACE: Specify the outbound interface slirp should bind to (ipv6 traffic only).
684-
# - outbound_addr6=IPv6: Specify the outbound ipv6 address slirp should bind to.
685-
# - port_handler=rootlesskit: Use rootlesskit for port forwarding. Default.
686-
# Note: Rootlesskit changes the source IP address of incoming packets to a IP address in the container
687-
# network namespace, usually `10.0.2.100`. If your application requires the real source IP address,
688-
# e.g. web server logs, use the slirp4netns port handler. The rootlesskit port handler is also used for
689-
# rootless containers when connected to user-defined networks.
690-
# - port_handler=slirp4netns: Use the slirp4netns port forwarding, it is slower than rootlesskit but
691-
# preserves the correct source IP address. This port handler cannot be used for user-defined networks.
692-
#
693-
#network_cmd_options = []
694-
695669
# Whether to use chroot instead of pivot_root in the runtime
696670
#
697671
#no_pivot_root = false

common/pkg/config/containers.conf-freebsd

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,12 @@ default_sysctls = [
169169
#
170170
#log_driver = "k8s-file"
171171

172-
# Default path for container logs to be stored in. When empty, logs will be stored
172+
# Default path for container logs to be stored in. When empty, logs will be stored
173173
# in the container's default storage and removed when the container is removed.
174-
# A subdirectory named with the container ID will be created under the specified
174+
# A subdirectory named with the container ID will be created under the specified
175175
# path, and the log file will have the default name `ctr.log` within that directory.
176176
# This option can be overridden by the `--log-opt` flag.
177-
#
177+
#
178178
#log_path = ""
179179

180180
# Maximum size allowed for the container log file. Negative numbers indicate
@@ -499,32 +499,6 @@ default_sysctls = [
499499
#
500500
#namespace = ""
501501

502-
# Path to the slirp4netns binary
503-
#
504-
#network_cmd_path = ""
505-
506-
# Default options to pass to the slirp4netns binary.
507-
# Valid options values are:
508-
#
509-
# - allow_host_loopback=true|false: Allow the slirp4netns to reach the host loopback IP (`10.0.2.2`).
510-
# Default is false.
511-
# - mtu=MTU: Specify the MTU to use for this network. (Default is `65520`).
512-
# - cidr=CIDR: Specify ip range to use for this network. (Default is `10.0.2.0/24`).
513-
# - enable_ipv6=true|false: Enable IPv6. Default is true. (Required for `outbound_addr6`).
514-
# - outbound_addr=INTERFACE: Specify the outbound interface slirp should bind to (ipv4 traffic only).
515-
# - outbound_addr=IPv4: Specify the outbound ipv4 address slirp should bind to.
516-
# - outbound_addr6=INTERFACE: Specify the outbound interface slirp should bind to (ipv6 traffic only).
517-
# - outbound_addr6=IPv6: Specify the outbound ipv6 address slirp should bind to.
518-
# - port_handler=rootlesskit: Use rootlesskit for port forwarding. Default.
519-
# Note: Rootlesskit changes the source IP address of incoming packets to a IP address in the container
520-
# network namespace, usually `10.0.2.100`. If your application requires the real source IP address,
521-
# e.g. web server logs, use the slirp4netns port handler. The rootlesskit port handler is also used for
522-
# rootless containers when connected to user-defined networks.
523-
# - port_handler=slirp4netns: Use the slirp4netns port forwarding, it is slower than rootlesskit but
524-
# preserves the correct source IP address. This port handler cannot be used for user-defined networks.
525-
#
526-
#network_cmd_options = []
527-
528502
# Whether to use chroot instead of pivot_root in the runtime
529503
#
530504
#no_pivot_root = false

common/pkg/config/testdata/containers_default.conf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,6 @@ network_config_dir = "/etc/cni/net.d/"
126126

127127
default_subnet_pools = [{"base" = "10.89.0.0/16", "size" = 24}, {"base" = "10.90.0.0/15", "size" = 24}]
128128

129-
default_rootless_network_cmd = "slirp4netns"
130-
131129
# firewall driver to be used by default
132130
firewall_driver = "none"
133131

0 commit comments

Comments
 (0)