api: add container's id to ContainerStatus

Sometimes for external applications it is useful to correlate the pod
containers to the real docker instances.

This patch adds a new entry in the container status (containerID) which
is used to identify the instance.

Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
This commit is contained in:
Federico Simoncelli 2014-12-03 08:31:42 +00:00
parent 17475cdbe7
commit 4af64b8911
5 changed files with 9 additions and 4 deletions

View File

@ -405,6 +405,7 @@ type ContainerStatus struct {
PodIP string `json:"podIP,omitempty"`
// TODO(dchen1107): Need to decide how to represent this in v1beta3
Image string `json:"image"`
ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://<container_id>'"`
}
// PodInfo contains one entry for every container with available info.

View File

@ -364,6 +364,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"`
ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://<container_id>'"`
}
// PodInfo contains one entry for every container with available info.

View File

@ -329,6 +329,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"`
ContainerID string `json:"containerID,omitempty" description:"container's ID in the format 'docker://<container_id>'"`
}
// PodInfo contains one entry for every container with available info.

View File

@ -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://<container_id>'"`
}
// PodInfo contains one entry for every container with available info.

View File

@ -390,6 +390,7 @@ 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,
}
waiting := true