diff --git a/pkg/api/types.go b/pkg/api/types.go index d9faa953358..be7844e0e27 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -442,6 +442,7 @@ type ContainerStatus struct { PodIP string `json:"podIP,omitempty"` // TODO(dchen1107): Need to decide how to represent this in v1beta3 Image string `json:"image"` + ImageID string `json:"imageID" description:"ID of the container's image"` ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 5d244693f1d..23b2b5c14a1 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -408,6 +408,7 @@ type ContainerStatus struct { PodIP string `json:"podIP,omitempty" description:"pod's IP address"` // TODO(dchen1107): Need to decide how to reprensent this in v1beta3 Image string `json:"image" description:"image of the container"` + ImageID string `json:"imageID" description:"ID of the container's image"` ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 5a8cad5d588..8d042ceee8c 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -372,6 +372,7 @@ type ContainerStatus struct { PodIP string `json:"podIP,omitempty" description:"pod's IP address"` // TODO(dchen1107): Need to decide how to reprensent this in v1beta3 Image string `json:"image" description:"image of the container"` + ImageID string `json:"imageID" description:"ID of the container's image"` ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 5e64ec17732..89ae8ccd025 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -464,7 +464,8 @@ type ContainerStatus struct { PodIP string `json:"podIP,omitempty"` // TODO(dchen1107): Which image the container is running with? // The image the container is running - Image string `json:"image"` + Image string `json:"image"` + ImageID string `json:"imageID" description:"ID of the container's image"` } // PodInfo contains one entry for every container with available info. diff --git a/pkg/kubelet/dockertools/docker.go b/pkg/kubelet/dockertools/docker.go index 41e5a98ef66..bbe6b86f0bf 100644 --- a/pkg/kubelet/dockertools/docker.go +++ b/pkg/kubelet/dockertools/docker.go @@ -41,6 +41,7 @@ import ( const ( PodInfraContainerName = leaky.PodInfraContainerName + DockerPrefix = "docker://" ) // DockerInterface is an abstract interface for testability. It abstracts the interface of docker.Client. @@ -399,7 +400,8 @@ func inspectContainer(client DockerInterface, dockerID, containerName, tPath str glog.V(3).Infof("Container inspect result: %+v", *inspectResult) containerStatus := api.ContainerStatus{ Image: inspectResult.Config.Image, - ContainerID: "docker://" + dockerID, + ImageID: DockerPrefix + inspectResult.Image, + ContainerID: DockerPrefix + dockerID, } waiting := true