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
@@ -46,7 +46,9 @@ func (i *createContainerInterceptor) InterceptRequest(r *http.Request) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if cidrs, ok := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig); ok {
|
||||
if cidrs, err := i.proxy.weaveCIDRsFromConfig(container.Config, container.HostConfig); err != nil {
|
||||
Info.Printf("Ignoring container due to %s", err)
|
||||
} else {
|
||||
Info.Printf("Creating container with WEAVE_CIDR \"%s\"", strings.Join(cidrs, " "))
|
||||
if container.HostConfig == nil {
|
||||
container.HostConfig = &docker.HostConfig{}
|
||||
|
||||
Reference in new issue
Block a user