瀏覽代碼

Fix long startup on windows, with non-hns governed Hyper-V networks

Similar to a related issue where previously, private Hyper-V networks
would each add 15 secs to the daemon startup, non-hns governed internal
networks are reported by hns as network type "internal" which is not
mapped to any network plugin (and thus we get the same plugin load retry
loop as before).

This issue hits Docker for Desktop because we setup such a network for
the Linux VM communication.

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
(cherry picked from commit 6a1a4f97217b0a8635bc21fc86628f48bf8824d1)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Simon Ferquel 6 年之前
父節點
當前提交
54bd14a3fe
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      daemon/daemon_windows.go

+ 2 - 1
daemon/daemon_windows.go

@@ -323,7 +323,8 @@ func (daemon *Daemon) initNetworkController(config *config.Config, activeSandbox
 	// discover and add HNS networks to windows
 	// discover and add HNS networks to windows
 	// network that exist are removed and added again
 	// network that exist are removed and added again
 	for _, v := range hnsresponse {
 	for _, v := range hnsresponse {
-		if strings.ToLower(v.Type) == "private" {
+		networkTypeNorm := strings.ToLower(v.Type)
+		if networkTypeNorm == "private" || networkTypeNorm == "internal" {
 			continue // workaround for HNS reporting unsupported networks
 			continue // workaround for HNS reporting unsupported networks
 		}
 		}
 		var n libnetwork.Network
 		var n libnetwork.Network