Browse code

Ignore HNS networks with type Private

Fix #33052 (workaround style)

**- What I did**

HNS reports networks that don't have anything to do with the Daemon, and
for which no networking plugin is available. This make the Daemon start
sequence pause for 15 secs, as the plugin resolving logic has a wait &
retry logic

**- How I did it**

Just after retrieving the HNS networks, I filter out those with type
`Private`

**- How to verify it**

Replace dockerd coming with Docker for Windows from one built from this
PR. Windows containers daemon should now launch pretty quickly

Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>

Simon Ferquel authored on 2017/05/06 01:03:22
Showing 1 changed files
... ...
@@ -327,6 +327,9 @@ func (daemon *Daemon) initNetworkController(config *config.Config, activeSandbox
327 327
 	// discover and add HNS networks to windows
328 328
 	// network that exist are removed and added again
329 329
 	for _, v := range hnsresponse {
330
+		if strings.ToLower(v.Type) == "private" {
331
+			continue // workaround for HNS reporting unsupported networks
332
+		}
330 333
 		var n libnetwork.Network
331 334
 		s := func(current libnetwork.Network) bool {
332 335
 			options := current.Info().DriverOptions()