Skip to content

Commit eb0d916

Browse files
committed
remove l2bridge checker and l2tunnel mode
1 parent 11983b1 commit eb0d916

File tree

6 files changed

+4
-27
lines changed

6 files changed

+4
-27
lines changed

cni/azure-windows-swift-overlay-dualstack.conflist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"plugins": [
66
{
77
"type": "azure-vnet",
8-
"mode": "bridge",
98
"bridge": "azure0",
109
"capabilities": {
1110
"portMappings": true,

cni/azure-windows-swift-overlay.conflist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"plugins": [
66
{
77
"type": "azure-vnet",
8-
"mode": "bridge",
98
"bridge": "azure0",
109
"capabilities": {
1110
"portMappings": true,

cni/azure-windows-swift.conflist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"plugins": [
66
{
77
"type": "azure-vnet",
8-
"mode": "bridge",
98
"bridge": "azure0",
109
"executionMode": "v4swift",
1110
"capabilities": {

cns/hnsclient/hnsclient_windows.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const (
3030

3131
// HNS network types
3232
hnsL2Bridge = "l2bridge"
33-
hnsL2Tunnel = "l2tunnel"
3433

3534
// hcnSchemaVersionMajor indicates major version number for hcn schema
3635
hcnSchemaVersionMajor = 2
@@ -145,7 +144,7 @@ func CreateDefaultExtNetwork(networkType string) error {
145144
return nil
146145
}
147146

148-
if networkType != hnsL2Bridge && networkType != hnsL2Tunnel {
147+
if networkType != hnsL2Bridge {
149148
return fmt.Errorf("Invalid hns network type %s", networkType)
150149
}
151150

cns/service/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ var args = acn.ArgumentList{
244244
{
245245
Name: acn.OptCreateDefaultExtNetworkType,
246246
Shorthand: acn.OptCreateDefaultExtNetworkTypeAlias,
247-
Description: "Create default external network for windows platform with the specified type (l2bridge or l2tunnel)",
247+
Description: "Create default external network for windows platform with the specified type (l2bridge)",
248248
Type: "string",
249249
DefaultValue: "",
250250
},

network/network_windows.go

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
const (
2525
// HNS network types.
2626
hnsL2bridge = "l2bridge"
27-
hnsL2tunnel = "l2tunnel"
2827
CnetAddressSpace = "cnetAddressSpace"
2928
vEthernetAdapterPrefix = "vEthernet"
3029
baseDecimal = 10
@@ -113,6 +112,7 @@ func (nm *networkManager) newNetworkImplHnsV1(nwInfo *EndpointInfo, extIf *exter
113112
// Initialize HNS network.
114113
hnsNetwork := &hcsshim.HNSNetwork{
115114
Name: nwInfo.NetworkID,
115+
Type: hnsL2bridge,
116116
NetworkAdapterName: networkAdapterName,
117117
Policies: policy.SerializePolicies(policy.NetworkPolicy, nwInfo.NetworkPolicies, nil, false, false),
118118
}
@@ -132,16 +132,6 @@ func (nm *networkManager) newNetworkImplHnsV1(nwInfo *EndpointInfo, extIf *exter
132132
vlanid = (int)(vlanPolicy.VLAN)
133133
}
134134

135-
// Set network mode.
136-
switch nwInfo.Mode {
137-
case opModeBridge:
138-
hnsNetwork.Type = hnsL2bridge
139-
case opModeTunnel:
140-
hnsNetwork.Type = hnsL2tunnel
141-
default:
142-
return nil, errNetworkModeInvalid
143-
}
144-
145135
// Populate subnets.
146136
for _, subnet := range nwInfo.Subnets {
147137
hnsSubnet := hcsshim.Subnet{
@@ -233,6 +223,7 @@ func (nm *networkManager) configureHcnNetwork(nwInfo *EndpointInfo, extIf *exter
233223
// Initialize HNS network.
234224
hcnNetwork := &hcn.HostComputeNetwork{
235225
Name: nwInfo.NetworkID,
226+
Type: hcn.L2Bridge
236227
Ipams: []hcn.Ipam{
237228
{
238229
Type: hcnIpamTypeStatic,
@@ -287,16 +278,6 @@ func (nm *networkManager) configureHcnNetwork(nwInfo *EndpointInfo, extIf *exter
287278
vlanid = (int)(vlanID)
288279
}
289280

290-
// Set network mode.
291-
switch nwInfo.Mode {
292-
case opModeBridge:
293-
hcnNetwork.Type = hcn.L2Bridge
294-
case opModeTunnel:
295-
hcnNetwork.Type = hcn.L2Tunnel
296-
default:
297-
return nil, errNetworkModeInvalid
298-
}
299-
300281
// AccelnetNIC flag: hcn.EnableIov(9216) - treat Delegated/FrontendNIC also the same as Accelnet
301282
// For L1VH with accelnet, hcn.DisableHostPort and hcn.EnableIov must be configured
302283
if nwInfo.NICType == cns.NodeNetworkInterfaceFrontendNIC {

0 commit comments

Comments
 (0)