Update ContainerState.Termination to ContainerState.Terminated in pkg/api/types.go and pkg/api/v1/types.go

This commit is contained in:
Chao Xu
2015-05-27 15:02:11 -07:00
parent 677d0fdf87
commit 2f6e5e2e08
20 changed files with 217 additions and 169 deletions

View File

@@ -57,7 +57,7 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
// Get all dead container status.
var resultStatus []*api.ContainerStatus
for i, containerStatus := range podStatus.ContainerStatuses {
if containerStatus.Name == container.Name && containerStatus.State.Termination != nil {
if containerStatus.Name == container.Name && containerStatus.State.Terminated != nil {
resultStatus = append(resultStatus, &podStatus.ContainerStatuses[i])
}
}
@@ -76,7 +76,7 @@ func ShouldContainerBeRestarted(container *api.Container, pod *api.Pod, podStatu
if pod.Spec.RestartPolicy == api.RestartPolicyOnFailure {
// Check the exit code of last run. Note: This assumes the result is sorted
// by the created time in reverse order.
if resultStatus[0].State.Termination.ExitCode == 0 {
if resultStatus[0].State.Terminated.ExitCode == 0 {
glog.V(4).Infof("Already successfully ran container %q of pod %q, do nothing", container.Name, podFullName)
return false
}