Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: add image's id to ContainerStatus #4191

Merged
merged 1 commit into from
Feb 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,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://<container_id>'"`
}

Expand Down
1 change: 1 addition & 0 deletions pkg/api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,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://<container_id>'"`
}

Expand Down
1 change: 1 addition & 0 deletions pkg/api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,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://<container_id>'"`
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/api/v1beta3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,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.
Expand Down
4 changes: 3 additions & 1 deletion pkg/kubelet/dockertools/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down