diff --git a/hack/e2e-suite/basic.sh b/hack/e2e-suite/basic.sh index 1f38ceb4b7b..793aac0dba3 100755 --- a/hack/e2e-suite/basic.sh +++ b/hack/e2e-suite/basic.sh @@ -50,7 +50,7 @@ while [ $ALL_RUNNING -ne 1 ]; do ALL_RUNNING=1 for id in $POD_ID_LIST; do CURRENT_STATUS=$($KUBECFG -template '{{and .CurrentState.Info.mynginx.State.Running .CurrentState.Info.net.State.Running}}' get pods/$id) - if [ "$CURRENT_STATUS" != "{}" ]; then + if [ "$CURRENT_STATUS" != "{0001-01-01 00:00:00 +0000 UTC}" ]; then ALL_RUNNING=0 fi done diff --git a/hack/e2e-suite/update.sh b/hack/e2e-suite/update.sh index 471646497e1..d5a3ebe15e9 100755 --- a/hack/e2e-suite/update.sh +++ b/hack/e2e-suite/update.sh @@ -47,12 +47,12 @@ function validate() { local template_string current_status current_image host_ip template_string="{{and ((index .CurrentState.Info \"${CONTROLLER_NAME}\").State.Running) .CurrentState.Info.net.State.Running}}" current_status=$($KUBECFG -template="${template_string}" get "pods/$id") - if [[ "$current_status" != "{}" ]]; then + if [ "$current_status" != "{0001-01-01 00:00:00 +0000 UTC}" ]; then echo " $id is created but not running" continue fi - template_string="{{(index .CurrentState.Info \"${CONTROLLER_NAME}\").DetailInfo.Config.Image}}" + template_string="{{(index .CurrentState.Info \"${CONTROLLER_NAME}\").Image}}" current_image=$($KUBECFG -template="${template_string}" get "pods/$id") if [[ "$current_image" != "${DOCKER_HUB_USER}/update-demo:${container_image_version}" ]]; then echo " ${id} is created but running wrong image" diff --git a/pkg/api/types.go b/pkg/api/types.go index cf8d26c2c95..e7a99ef66c8 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -329,6 +329,8 @@ type ContainerStatus struct { // TODO(dchen1107): Deprecated this soon once we pull entire PodStatus from node, // not just PodInfo. Now we need this to remove docker.Container from API PodIP string `json:"podIP,omitempty" yaml:"podIP,omitempty"` + // TODO(dchen1107): Need to decide how to reprensent this in v1beta3 + Image string `yaml:"image" json:"image"` // TODO(dchen1107): Once we have done with integration with cadvisor, resource // usage should be included. } diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index fd90690a474..dc88f1cd4c2 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -314,6 +314,8 @@ type ContainerStatus struct { // TODO(dchen1107): Deprecated this soon once we pull entire PodStatus from node, // not just PodInfo. Now we need this to remove docker.Container from API PodIP string `json:"podIP,omitempty" yaml:"podIP,omitempty"` + // TODO(dchen1107): Need to decide how to reprensent this in v1beta3 + Image string `yaml:"image" json:"image"` // TODO(dchen1107): Once we have done with integration with cadvisor, resource // usage should be included. } diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 5ede4b4c7d4..770a1cb8ca3 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -310,6 +310,8 @@ type ContainerStatus struct { // TODO(dchen1107): Deprecated this soon once we pull entire PodStatus from node, // not just PodInfo. Now we need this to remove docker.Container from API PodIP string `json:"podIP,omitempty" yaml:"podIP,omitempty"` + // TODO(dchen1107): Need to decide how to reprensent this in v1beta3 + Image string `yaml:"image" json:"image"` // TODO(dchen1107): Once we have done with integration with cadvisor, resource // usage should be included. } diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index f04a3c8fded..84f2f0869ea 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -338,6 +338,7 @@ type ContainerStatus struct { State ContainerState `json:"state,omitempty" yaml:"state,omitempty"` RestartCount int `json:"restartCount" yaml:"restartCount"` // TODO(dchen1107): Introduce our own NetworkSettings struct here? + // TODO(dchen1107): Which image the container is running with? // TODO(dchen1107): Once we have done with integration with cadvisor, resource // usage should be included. } diff --git a/pkg/kubelet/dockertools/docker.go b/pkg/kubelet/dockertools/docker.go index d97010254a5..314788fade7 100644 --- a/pkg/kubelet/dockertools/docker.go +++ b/pkg/kubelet/dockertools/docker.go @@ -293,8 +293,9 @@ func inspectContainer(client DockerInterface, dockerID, containerName string) (* glog.V(3).Infof("Container: %s [%s] inspect result %+v", *inspectResult) var containerStatus api.ContainerStatus - waiting := true + containerStatus.Image = inspectResult.Config.Image + waiting := true if inspectResult.State.Running { containerStatus.State.Running = &api.ContainerStateRunning{ StartedAt: inspectResult.State.StartedAt,