Make inspect-rewrite wait if the start operation is still in progress
This commit is contained in:
1 parent
a6336149f8
commit
5eaff802d4
3 files changed
+21
-3
No files matched your search
@@ -22,19 +22,20 @@ func (i *inspectContainerInterceptor) InterceptResponse(r *http.Response) error
|
||||
return err
|
||||
}
|
||||
|
||||
if err := updateContainerNetworkSettings(container); err != nil {
|
||||
if err := updateContainerNetworkSettings(container, i.proxy); err != nil {
|
||||
Log.Warningf("Inspecting container %s failed: %s", container["Id"], err)
|
||||
}
|
||||
|
||||
return marshalResponseBody(r, container)
|
||||
}
|
||||
|
||||
func updateContainerNetworkSettings(container jsonObject) error {
|
||||
func updateContainerNetworkSettings(container jsonObject, proxy *Proxy) error {
|
||||
containerID, err := container.String("Id")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
proxy.waitForStartByIdent(containerID)
|
||||
mac, ips, nets, err := weaveContainerIPs(containerID)
|
||||
if err != nil || len(ips) == 0 {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user