refactor weaveCIDRsFromConfig to return an error message
This commit is contained in:
1 parent
9619a27f8c
commit
c6fa9cb17e
4 files changed
+25
-26
No files matched your search
@@ -30,8 +30,10 @@ func (i *createExecInterceptor) InterceptRequest(r *http.Request) error {
|
||||
}
|
||||
|
||||
_, hasWeaveWait := container.Volumes["/w"]
|
||||
cidrs, hasCIDRs := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig)
|
||||
if hasCIDRs && hasWeaveWait {
|
||||
cidrs, err := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig)
|
||||
if err != nil {
|
||||
Info.Printf("Ignoring container %s due to %s", container.ID, err)
|
||||
} else if 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...)
|
||||
|
||||
Reference in new issue
Block a user