[proxy] refactor weaveCIDRsFromConfig slightly

This commit is contained in:
Paul Bellamy committed 2015-06-17 14:51:12 +01:00
1 parent ca681bce13
commit 6c26a55b5a
5 files changed
+16 -16

No files matched your search

-13
View File
@@ -8,7 +8,6 @@ import (
"net/http"
"os/exec"
"regexp"
"strings"
"github.com/fsouza/go-dockerclient"
. "github.com/weaveworks/weave/common"
@@ -28,18 +27,6 @@ func callWeave(args ...string) ([]byte, error) {
return out, err
}
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, !noDefaultIPAM
}
func marshalRequestBody(r *http.Request, body interface{}) error {
newBody, err := json.Marshal(body)
if err != nil {