Add delay immediately after network creation for 1803 & below (#174)

This commit is contained in:
Madhan Raj Mookkandy 2018-07-02 14:20:05 -07:00 коммит произвёл Sushant Sharma
Родитель 092b0da50a
Коммит 5f5880964f
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -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
}