Skip to content

Commit 5f58809

Browse files
madhanrmsharmasushant
authored andcommitted
Add delay immediately after network creation for 1803 & below (#174)
1 parent 092b0da commit 5f58809

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

network/network_windows.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package network
88
import (
99
"encoding/json"
1010
"strings"
11+
"time"
1112

1213
"github.com/Azure/azure-container-networking/log"
1314
"github.com/Azure/azure-container-networking/network/policy"
@@ -78,6 +79,14 @@ func (nm *networkManager) newNetworkImpl(nwInfo *NetworkInfo, extIf *externalInt
7879
extIf: extIf,
7980
}
8081

82+
globals, err := hcsshim.GetHNSGlobals()
83+
if err != nil || globals.Version.Major <= hcsshim.HNSVersion1803.Major {
84+
// err would be not nil for windows 1709 & below
85+
// Sleep for 10 seconds as a workaround for windows 1803 & below
86+
// This is done only when the network is created.
87+
time.Sleep(time.Duration(10) * time.Second)
88+
}
89+
8190
return nw, nil
8291
}
8392

0 commit comments

Comments
 (0)