Sfoglia il codice sorgente

Add hostconfig to container inspect

Michael Crosby 11 anni fa
parent
commit
c4c90e9cec
2 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 4 1
      api.go
  2. 4 0
      api_params.go

+ 4 - 1
api.go

@@ -874,7 +874,10 @@ func getContainersByName(srv *Server, version float64, w http.ResponseWriter, r
 		return fmt.Errorf("Conflict between containers and images")
 	}
 
-	return writeJSON(w, http.StatusOK, container)
+	container.readHostConfig()
+	c := APIContainer{container, container.hostConfig}
+
+	return writeJSON(w, http.StatusOK, c)
 }
 
 func getImagesByName(srv *Server, version float64, w http.ResponseWriter, r *http.Request, vars map[string]string) error {

+ 4 - 0
api_params.go

@@ -118,6 +118,10 @@ type (
 		Resource string
 		HostPath string
 	}
+	APIContainer struct {
+		*Container
+		HostConfig *HostConfig
+	}
 )
 
 func (api APIImages) ToLegacy() []APIImagesOld {