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
@@ -21,13 +21,9 @@ func (i *startContainerInterceptor) InterceptResponse(r *http.Response) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if !validNetworkMode(container.HostConfig) {
|
||||
Debug.Printf("Ignoring container %s with --net=%s", container.ID, networkMode(container.HostConfig))
|
||||
return nil
|
||||
}
|
||||
cidrs, ok := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig)
|
||||
if !ok {
|
||||
Debug.Print("No Weave CIDR, ignoring")
|
||||
cidrs, err := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig)
|
||||
if err != nil {
|
||||
Info.Printf("Ignoring container %s due to %s", container.ID, err)
|
||||
return nil
|
||||
}
|
||||
Info.Printf("Attaching container %s with WEAVE_CIDR \"%s\" to weave network", container.ID, strings.Join(cidrs, " "))
|
||||
|
||||
Reference in new issue
Block a user