mirror of https://github.com/docker/docs.git
fix node field in docker inspect
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
This commit is contained in:
parent
14108ccaa1
commit
d1c41e0d43
|
|
@ -188,8 +188,14 @@ func getContainerJSON(c *context, w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
n, err := json.Marshal(container.Engine)
|
||||
if err != nil {
|
||||
httpError(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
// insert Node field
|
||||
data = bytes.Replace(data, []byte("\"Name\":\"/"), []byte(fmt.Sprintf("\"Node\":%s,\"Name\":\"/", container.Engine)), -1)
|
||||
data = bytes.Replace(data, []byte("\"Name\":\"/"), []byte(fmt.Sprintf("\"Node\":%s,\"Name\":\"/", n)), -1)
|
||||
|
||||
// insert node IP
|
||||
data = bytes.Replace(data, []byte("\"HostIp\":\"0.0.0.0\""), []byte(fmt.Sprintf("\"HostIp\":%q", container.Engine.IP)), -1)
|
||||
|
|
|
|||
Loading…
Reference in New Issue