Don't weave-attach containers which are using a network plugin
Particularly intended for cases where the user has configured the proxy and also said --net=weave, but will catch any other plugin similarly
This commit is contained in:
1 parent
1d91c1a23b
commit
dac2124cd1
1 file changed
+3
-1
+3
-1
@@ -534,7 +534,9 @@ func callWeaveAttach(container *docker.Container, args []string) error {
|
||||
}
|
||||
|
||||
func (proxy *Proxy) weaveCIDRs(networkMode string, env []string) ([]string, error) {
|
||||
if networkMode == "host" || strings.HasPrefix(networkMode, "container:") {
|
||||
if networkMode == "host" || strings.HasPrefix(networkMode, "container:") ||
|
||||
// Anything else, other than blank/none/default/bridge, is some sort of network plugin
|
||||
(networkMode != "" && networkMode != "none" && networkMode != "default" && networkMode != "bridge") {
|
||||
return nil, fmt.Errorf("the container has '--net=%s'", networkMode)
|
||||
}
|
||||
for _, e := range env {
|
||||
|
||||
Reference in new issue
Block a user