mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Fix e2e tests.
This commit is contained in:
		@@ -50,7 +50,7 @@ while [ $ALL_RUNNING -ne 1 ]; do
 | 
				
			|||||||
  ALL_RUNNING=1
 | 
					  ALL_RUNNING=1
 | 
				
			||||||
  for id in $POD_ID_LIST; do
 | 
					  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)
 | 
					    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
 | 
					      ALL_RUNNING=0
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
  done
 | 
					  done
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -47,12 +47,12 @@ function validate() {
 | 
				
			|||||||
      local template_string current_status current_image host_ip
 | 
					      local template_string current_status current_image host_ip
 | 
				
			||||||
      template_string="{{and ((index .CurrentState.Info \"${CONTROLLER_NAME}\").State.Running) .CurrentState.Info.net.State.Running}}"
 | 
					      template_string="{{and ((index .CurrentState.Info \"${CONTROLLER_NAME}\").State.Running) .CurrentState.Info.net.State.Running}}"
 | 
				
			||||||
      current_status=$($KUBECFG -template="${template_string}" get "pods/$id")
 | 
					      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"
 | 
					        echo "  $id is created but not running"
 | 
				
			||||||
        continue
 | 
					        continue
 | 
				
			||||||
      fi
 | 
					      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")
 | 
					      current_image=$($KUBECFG -template="${template_string}" get "pods/$id")
 | 
				
			||||||
      if [[ "$current_image" != "${DOCKER_HUB_USER}/update-demo:${container_image_version}" ]]; then
 | 
					      if [[ "$current_image" != "${DOCKER_HUB_USER}/update-demo:${container_image_version}" ]]; then
 | 
				
			||||||
        echo "  ${id} is created but running wrong image"
 | 
					        echo "  ${id} is created but running wrong image"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -329,6 +329,8 @@ type ContainerStatus struct {
 | 
				
			|||||||
	// TODO(dchen1107): Deprecated this soon once we pull entire PodStatus from node,
 | 
						// 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
 | 
						// not just PodInfo. Now we need this to remove docker.Container from API
 | 
				
			||||||
	PodIP string `json:"podIP,omitempty" yaml:"podIP,omitempty"`
 | 
						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
 | 
						// TODO(dchen1107): Once we have done with integration with cadvisor, resource
 | 
				
			||||||
	// usage should be included.
 | 
						// usage should be included.
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -314,6 +314,8 @@ type ContainerStatus struct {
 | 
				
			|||||||
	// TODO(dchen1107): Deprecated this soon once we pull entire PodStatus from node,
 | 
						// 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
 | 
						// not just PodInfo. Now we need this to remove docker.Container from API
 | 
				
			||||||
	PodIP string `json:"podIP,omitempty" yaml:"podIP,omitempty"`
 | 
						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
 | 
						// TODO(dchen1107): Once we have done with integration with cadvisor, resource
 | 
				
			||||||
	// usage should be included.
 | 
						// usage should be included.
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -310,6 +310,8 @@ type ContainerStatus struct {
 | 
				
			|||||||
	// TODO(dchen1107): Deprecated this soon once we pull entire PodStatus from node,
 | 
						// 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
 | 
						// not just PodInfo. Now we need this to remove docker.Container from API
 | 
				
			||||||
	PodIP string `json:"podIP,omitempty" yaml:"podIP,omitempty"`
 | 
						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
 | 
						// TODO(dchen1107): Once we have done with integration with cadvisor, resource
 | 
				
			||||||
	// usage should be included.
 | 
						// usage should be included.
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -338,6 +338,7 @@ type ContainerStatus struct {
 | 
				
			|||||||
	State        ContainerState `json:"state,omitempty" yaml:"state,omitempty"`
 | 
						State        ContainerState `json:"state,omitempty" yaml:"state,omitempty"`
 | 
				
			||||||
	RestartCount int            `json:"restartCount" yaml:"restartCount"`
 | 
						RestartCount int            `json:"restartCount" yaml:"restartCount"`
 | 
				
			||||||
	// TODO(dchen1107): Introduce our own NetworkSettings struct here?
 | 
						// 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
 | 
						// TODO(dchen1107): Once we have done with integration with cadvisor, resource
 | 
				
			||||||
	// usage should be included.
 | 
						// usage should be included.
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -293,8 +293,9 @@ func inspectContainer(client DockerInterface, dockerID, containerName string) (*
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	glog.V(3).Infof("Container: %s [%s] inspect result %+v", *inspectResult)
 | 
						glog.V(3).Infof("Container: %s [%s] inspect result %+v", *inspectResult)
 | 
				
			||||||
	var containerStatus api.ContainerStatus
 | 
						var containerStatus api.ContainerStatus
 | 
				
			||||||
	waiting := true
 | 
						containerStatus.Image = inspectResult.Config.Image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						waiting := true
 | 
				
			||||||
	if inspectResult.State.Running {
 | 
						if inspectResult.State.Running {
 | 
				
			||||||
		containerStatus.State.Running = &api.ContainerStateRunning{
 | 
							containerStatus.State.Running = &api.ContainerStateRunning{
 | 
				
			||||||
			StartedAt: inspectResult.State.StartedAt,
 | 
								StartedAt: inspectResult.State.StartedAt,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user