mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 06:32:32 +00:00
Update ContainerState.Termination to ContainerState.Terminated in pkg/api/types.go and pkg/api/v1/types.go
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user