Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
vc: Remove unused variable NumInterfaces
Browse files Browse the repository at this point in the history
Remove unsed variable, the variable is set just in one place, and
never is used again.

Fixes: #603

Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
  • Loading branch information
jcvenegas committed Aug 17, 2018
1 parent 26f3107 commit 161e3a7
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 17 deletions.
8 changes: 2 additions & 6 deletions virtcontainers/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ func newTestSandboxConfigHyperstartAgentCNMNetwork() SandboxConfig {
PostStopHooks: []Hook{},
}

netConfig := NetworkConfig{
NumInterfaces: len(hooks.PreStartHooks),
}
netConfig := NetworkConfig{}

sandboxConfig := SandboxConfig{
ID: testSandboxID,
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion virtcontainers/documentation/api/1.0/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ const (
// NetworkConfig is the network configuration related to a network.
type NetworkConfig struct {
NetNSPath string
NumInterfaces int
InterworkingModel NetInterworkingModel
}
```
Expand Down
4 changes: 1 addition & 3 deletions virtcontainers/hack/virtc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion virtcontainers/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 0 additions & 3 deletions virtcontainers/pkg/oci/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 1 addition & 3 deletions virtcontainers/pkg/oci/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,7 @@ func TestMinimalSandboxConfig(t *testing.T) {
DeviceInfos: expectedDeviceInfo,
}

expectedNetworkConfig := vc.NetworkConfig{
NumInterfaces: 1,
}
expectedNetworkConfig := vc.NetworkConfig{}

expectedSandboxConfig := vc.SandboxConfig{
ID: containerID,
Expand Down

0 comments on commit 161e3a7

Please sign in to comment.