Browse code

Windows: Disable links

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2015/11/16 14:32:31
Showing 1 changed files
... ...
@@ -7,7 +7,6 @@ import (
7 7
 	"github.com/docker/docker/daemon/graphdriver"
8 8
 	// register the windows graph driver
9 9
 	_ "github.com/docker/docker/daemon/graphdriver/windows"
10
-	"github.com/docker/docker/pkg/parsers"
11 10
 	"github.com/docker/docker/pkg/system"
12 11
 	"github.com/docker/docker/runconfig"
13 12
 	"github.com/docker/libnetwork"
... ...
@@ -103,36 +102,8 @@ func (daemon *Daemon) initNetworkController(config *Config) (libnetwork.NetworkC
103 103
 }
104 104
 
105 105
 // registerLinks sets up links between containers and writes the
106
-// configuration out for persistence.
106
+// configuration out for persistence. As of Windows TP4, links are not supported.
107 107
 func (daemon *Daemon) registerLinks(container *Container, hostConfig *runconfig.HostConfig) error {
108
-	// TODO Windows. Factored out for network modes. There may be more
109
-	// refactoring required here.
110
-
111
-	if hostConfig == nil || hostConfig.Links == nil {
112
-		return nil
113
-	}
114
-
115
-	for _, l := range hostConfig.Links {
116
-		name, alias, err := parsers.ParseLink(l)
117
-		if err != nil {
118
-			return err
119
-		}
120
-		child, err := daemon.Get(name)
121
-		if err != nil {
122
-			//An error from daemon.Get() means this name could not be found
123
-			return fmt.Errorf("Could not get container for %s", name)
124
-		}
125
-		if err := daemon.registerLink(container, child, alias); err != nil {
126
-			return err
127
-		}
128
-	}
129
-
130
-	// After we load all the links into the daemon
131
-	// set them to nil on the hostconfig
132
-	hostConfig.Links = nil
133
-	if err := container.writeHostConfig(); err != nil {
134
-		return err
135
-	}
136 108
 	return nil
137 109
 }
138 110