[proxy] support new docker 1.8 --net="default"
This commit is contained in:
1 parent
f70dc6660a
commit
4961e83686
1 file changed
+4
-4
+4
-4
@@ -25,9 +25,8 @@ var (
|
|||||||
containerStartRegexp = regexp.MustCompile("^(/v[0-9\\.]*)?/containers/[^/]*/(re)?start$")
|
containerStartRegexp = regexp.MustCompile("^(/v[0-9\\.]*)?/containers/[^/]*/(re)?start$")
|
||||||
execCreateRegexp = regexp.MustCompile("^(/v[0-9\\.]*)?/containers/[^/]*/exec$")
|
execCreateRegexp = regexp.MustCompile("^(/v[0-9\\.]*)?/containers/[^/]*/exec$")
|
||||||
|
|
||||||
ErrInvalidNetworkMode = errors.New("--net option")
|
ErrWeaveCIDRNone = errors.New("WEAVE_CIDR=none")
|
||||||
ErrWeaveCIDRNone = errors.New("WEAVE_CIDR=none")
|
ErrNoDefaultIPAM = errors.New("--no-default-ipam option")
|
||||||
ErrNoDefaultIPAM = errors.New("--no-default-ipam option")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type Proxy struct {
|
type Proxy struct {
|
||||||
@@ -152,8 +151,9 @@ func (proxy *Proxy) ListenAndServe() error {
|
|||||||
func (proxy *Proxy) weaveCIDRsFromConfig(config *docker.Config, hostConfig *docker.HostConfig) ([]string, error) {
|
func (proxy *Proxy) weaveCIDRsFromConfig(config *docker.Config, hostConfig *docker.HostConfig) ([]string, error) {
|
||||||
if hostConfig != nil &&
|
if hostConfig != nil &&
|
||||||
hostConfig.NetworkMode != "" &&
|
hostConfig.NetworkMode != "" &&
|
||||||
|
hostConfig.NetworkMode != "default" &&
|
||||||
hostConfig.NetworkMode != "bridge" {
|
hostConfig.NetworkMode != "bridge" {
|
||||||
return nil, ErrInvalidNetworkMode
|
return nil, fmt.Errorf("--net option: %q", hostConfig.NetworkMode)
|
||||||
}
|
}
|
||||||
for _, e := range config.Env {
|
for _, e := range config.Env {
|
||||||
if strings.HasPrefix(e, "WEAVE_CIDR=") {
|
if strings.HasPrefix(e, "WEAVE_CIDR=") {
|
||||||
|
|||||||
Reference in new issue
Block a user