Merge pull request #1153 from weaveworks/1143-non-weave-exec
[proxy] should not attempt weavewait in on weave container's execs Fixes #1143.
This commit is contained in:
commit
a982146cbe
2 files changed
+7
-1
No files matched your search
@@ -29,7 +29,9 @@ func (i *createExecInterceptor) InterceptRequest(r *http.Request) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if cidrs, ok := i.proxy.weaveCIDRsFromConfig(container.Config); ok {
|
||||
_, hasWeaveWait := container.Volumes["/w"]
|
||||
cidrs, hasCIDRs := i.proxy.weaveCIDRsFromConfig(container.Config)
|
||||
if hasCIDRs && hasWeaveWait {
|
||||
Info.Printf("Exec in container %s with WEAVE_CIDR \"%s\"", container.ID, strings.Join(cidrs, " "))
|
||||
cmd := append(weaveWaitEntrypoint, "-s")
|
||||
options.Cmd = append(cmd, options.Cmd...)
|
||||
|
||||
@@ -21,4 +21,8 @@ COMMITTED_IMAGE=$(proxy docker_on $HOST1 commit c1)
|
||||
assert_raises "proxy docker_on $HOST1 run --name c2 $COMMITTED_IMAGE"
|
||||
assert "entrypoint c2" "$(entrypoint $COMMITTED_IMAGE)"
|
||||
|
||||
# Check exec works on containers without weavewait
|
||||
docker_on $HOST1 run -dit --name c3 $SMALL_IMAGE /bin/sh
|
||||
assert_raises "proxy docker_on $HOST1 exec c3 true"
|
||||
|
||||
end_suite
|
||||
Reference in new issue
Block a user