diff --git a/pkg/api/types.go b/pkg/api/types.go index 54501dea5e0..1ade6ae0442 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -404,7 +404,8 @@ type ContainerStatus struct { // not just PodInfo. Now we need this to remove docker.Container from API PodIP string `json:"podIP,omitempty"` // TODO(dchen1107): Need to decide how to represent this in v1beta3 - Image string `json:"image"` + Image string `json:"image"` + ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } // PodInfo contains one entry for every container with available info. diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 108ec89fce9..20d95b9a749 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -363,7 +363,8 @@ type ContainerStatus struct { // not just PodInfo. Now we need this to remove docker.Container from API 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"` + Image string `json:"image" description:"image of the container"` + ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } // PodInfo contains one entry for every container with available info. diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index dd2268c094b..f842ce15ad6 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -328,7 +328,8 @@ type ContainerStatus struct { // not just PodInfo. Now we need this to remove docker.Container from API 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"` + Image string `json:"image" description:"image of the container"` + ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } // PodInfo contains one entry for every container with available info. diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 69652e716ab..ad0760fcd23 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -422,6 +422,7 @@ type ContainerStatus struct { RestartCount int `json:"restartCount"` // TODO(dchen1107): Introduce our own NetworkSettings struct here? // TODO(dchen1107): Which image the container is running with? + ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://'"` } // 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 3b26f73458d..b69cf0ae10c 100644 --- a/pkg/kubelet/dockertools/docker.go +++ b/pkg/kubelet/dockertools/docker.go @@ -389,7 +389,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, + Image: inspectResult.Config.Image, + ContainerID: "docker://" + dockerID, } waiting := true