Skip to content

Commit ce1874c

Browse files
madhanrmsharmasushant
authored andcommitted
Filter out hostVnic, which would otherwise fail during network creation (#184)
1 parent 1f436d3 commit ce1874c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

network/network_windows.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,15 @@ type route interface{}
2626

2727
// NewNetworkImpl creates a new container network.
2828
func (nm *networkManager) newNetworkImpl(nwInfo *NetworkInfo, extIf *externalInterface) (*network, error) {
29+
networkAdapterName := extIf.Name
30+
// FixMe: Find a better way to check if a nic that is selected is not part of a vSwitch
31+
if strings.HasPrefix(networkAdapterName, "vEthernet") {
32+
networkAdapterName = ""
33+
}
2934
// Initialize HNS network.
3035
hnsNetwork := &hcsshim.HNSNetwork{
3136
Name: nwInfo.Id,
32-
NetworkAdapterName: extIf.Name,
37+
NetworkAdapterName: networkAdapterName,
3338
DNSSuffix: nwInfo.DNS.Suffix,
3439
DNSServerList: strings.Join(nwInfo.DNS.Servers, ","),
3540
Policies: policy.SerializePolicies(policy.NetworkPolicy, nwInfo.Policies),

0 commit comments

Comments
 (0)