diff --git a/network/network_windows.go b/network/network_windows.go index 29f23cf84d..6af88560fe 100644 --- a/network/network_windows.go +++ b/network/network_windows.go @@ -8,6 +8,7 @@ package network import ( "encoding/json" "strings" + "time" "github.com/Azure/azure-container-networking/log" "github.com/Azure/azure-container-networking/network/policy" @@ -78,6 +79,14 @@ func (nm *networkManager) newNetworkImpl(nwInfo *NetworkInfo, extIf *externalInt extIf: extIf, } + globals, err := hcsshim.GetHNSGlobals() + if err != nil || globals.Version.Major <= hcsshim.HNSVersion1803.Major { + // err would be not nil for windows 1709 & below + // Sleep for 10 seconds as a workaround for windows 1803 & below + // This is done only when the network is created. + time.Sleep(time.Duration(10) * time.Second) + } + return nw, nil }