diff --git a/virtcontainers/api_test.go b/virtcontainers/api_test.go index 11dca61e8..6fc29d0c5 100644 --- a/virtcontainers/api_test.go +++ b/virtcontainers/api_test.go @@ -152,9 +152,7 @@ func newTestSandboxConfigHyperstartAgentCNMNetwork() SandboxConfig { PostStopHooks: []Hook{}, } - netConfig := NetworkConfig{ - NumInterfaces: len(hooks.PreStartHooks), - } + netConfig := NetworkConfig{} sandboxConfig := SandboxConfig{ ID: testSandboxID, @@ -1980,9 +1978,7 @@ func createNewSandboxConfig(hType HypervisorType, aType AgentType, aConfig inter HypervisorPath: "/usr/bin/qemu-system-x86_64", } - netConfig := NetworkConfig{ - NumInterfaces: 1, - } + netConfig := NetworkConfig{} return SandboxConfig{ ID: testSandboxID, diff --git a/virtcontainers/documentation/api/1.0/api.md b/virtcontainers/documentation/api/1.0/api.md index b5621fe83..3802c2518 100644 --- a/virtcontainers/documentation/api/1.0/api.md +++ b/virtcontainers/documentation/api/1.0/api.md @@ -276,7 +276,6 @@ const ( // NetworkConfig is the network configuration related to a network. type NetworkConfig struct { NetNSPath string - NumInterfaces int InterworkingModel NetInterworkingModel } ``` diff --git a/virtcontainers/hack/virtc/main.go b/virtcontainers/hack/virtc/main.go index ec36019db..20a182b31 100644 --- a/virtcontainers/hack/virtc/main.go +++ b/virtcontainers/hack/virtc/main.go @@ -176,9 +176,7 @@ func buildSandboxConfig(context *cli.Context) (vc.SandboxConfig, error) { return vc.SandboxConfig{}, err } - netConfig := vc.NetworkConfig{ - NumInterfaces: 1, - } + netConfig := vc.NetworkConfig{} switch *agentType { case vc.HyperstartAgent: diff --git a/virtcontainers/network.go b/virtcontainers/network.go index bfbac528b..8546abc71 100644 --- a/virtcontainers/network.go +++ b/virtcontainers/network.go @@ -142,7 +142,6 @@ type NetworkInterfacePair struct { // NetworkConfig is the network configuration related to a network. type NetworkConfig struct { NetNSPath string - NumInterfaces int InterworkingModel NetInterworkingModel } diff --git a/virtcontainers/pkg/oci/utils.go b/virtcontainers/pkg/oci/utils.go index a94a3797c..ec01db9c6 100644 --- a/virtcontainers/pkg/oci/utils.go +++ b/virtcontainers/pkg/oci/utils.go @@ -357,9 +357,6 @@ func networkConfig(ocispec CompatOCISpec, config RuntimeConfig) (vc.NetworkConfi continue } - // Bug: This is not the interface count - // It is just an indication that you need networking - netConf.NumInterfaces = 1 if n.Path != "" { netConf.NetNSPath = n.Path } diff --git a/virtcontainers/pkg/oci/utils_test.go b/virtcontainers/pkg/oci/utils_test.go index e007986d2..ad5504c6b 100644 --- a/virtcontainers/pkg/oci/utils_test.go +++ b/virtcontainers/pkg/oci/utils_test.go @@ -211,9 +211,7 @@ func TestMinimalSandboxConfig(t *testing.T) { DeviceInfos: expectedDeviceInfo, } - expectedNetworkConfig := vc.NetworkConfig{ - NumInterfaces: 1, - } + expectedNetworkConfig := vc.NetworkConfig{} expectedSandboxConfig := vc.SandboxConfig{ ID: containerID,