From b493a47c4799c7b9f17c518c7eae46ecf8945935 Mon Sep 17 00:00:00 2001 From: Madhan Raj Mookkandy Date: Mon, 2 Jul 2018 14:18:54 -0700 Subject: [PATCH] Filter out hostVnic, which would otherwise fail during network creation --- network/network_windows.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/network/network_windows.go b/network/network_windows.go index 29f23cf84d..09fce3c0d3 100644 --- a/network/network_windows.go +++ b/network/network_windows.go @@ -25,10 +25,15 @@ type route interface{} // NewNetworkImpl creates a new container network. func (nm *networkManager) newNetworkImpl(nwInfo *NetworkInfo, extIf *externalInterface) (*network, error) { + networkAdapterName := extIf.Name + // FixMe: Find a better way to check if a nic that is selected is not part of a vSwitch + if strings.HasPrefix(networkAdapterName, "vEthernet") { + networkAdapterName = "" + } // Initialize HNS network. hnsNetwork := &hcsshim.HNSNetwork{ Name: nwInfo.Id, - NetworkAdapterName: extIf.Name, + NetworkAdapterName: networkAdapterName, DNSSuffix: nwInfo.DNS.Suffix, DNSServerList: strings.Join(nwInfo.DNS.Servers, ","), Policies: policy.SerializePolicies(policy.NetworkPolicy, nwInfo.Policies),