[proxy] Add support for WEAVE_CIDR=none
Tells the proxy not to do anything with this container. We set it when running weaveexec/weave/etc containers, so that the weave script works through the proxy.
This commit is contained in:
1 parent
ff838a14d9
commit
ca681bce13
8 files changed
+44
-15
No files matched your search
+5
-2
@@ -28,13 +28,16 @@ func callWeave(args ...string) ([]byte, error) {
|
||||
return out, err
|
||||
}
|
||||
|
||||
func weaveCIDRsFromConfig(config *docker.Config) ([]string, bool) {
|
||||
func weaveCIDRsFromConfig(config *docker.Config, noDefaultIPAM bool) ([]string, bool) {
|
||||
for _, e := range config.Env {
|
||||
if strings.HasPrefix(e, "WEAVE_CIDR=") {
|
||||
if e[11:] == "none" {
|
||||
return nil, false
|
||||
}
|
||||
return strings.Fields(e[11:]), true
|
||||
}
|
||||
}
|
||||
return nil, false
|
||||
return nil, !noDefaultIPAM
|
||||
}
|
||||
|
||||
func marshalRequestBody(r *http.Request, body interface{}) error {
|
||||
|
||||
Reference in new issue
Block a user