mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-11 06:02:18 +00:00
Update ContainerState.Termination to ContainerState.Terminated in pkg/api/types.go and pkg/api/v1/types.go
This commit is contained in:
@@ -271,15 +271,15 @@ func waitForPodSuccessInNamespace(c *client.Client, podName string, contName str
|
||||
if !ok {
|
||||
Logf("No Status.Info for container '%s' in pod '%s' yet", contName, podName)
|
||||
} else {
|
||||
if ci.State.Termination != nil {
|
||||
if ci.State.Termination.ExitCode == 0 {
|
||||
if ci.State.Terminated != nil {
|
||||
if ci.State.Terminated.ExitCode == 0 {
|
||||
By("Saw pod success")
|
||||
return true, nil
|
||||
} else {
|
||||
return true, fmt.Errorf("pod '%s' terminated with failure: %+v", podName, ci.State.Termination)
|
||||
return true, fmt.Errorf("pod '%s' terminated with failure: %+v", podName, ci.State.Terminated)
|
||||
}
|
||||
} else {
|
||||
Logf("Nil State.Termination for container '%s' in pod '%s' in namespace '%s' so far", contName, podName, namespace)
|
||||
Logf("Nil State.Terminated for container '%s' in pod '%s' in namespace '%s' so far", contName, podName, namespace)
|
||||
}
|
||||
}
|
||||
return false, nil
|
||||
@@ -875,10 +875,10 @@ func FailedContainers(pod api.Pod) map[string]ContainerFailures {
|
||||
return nil
|
||||
} else {
|
||||
for _, status := range statuses {
|
||||
if status.State.Termination != nil {
|
||||
states[status.ContainerID] = ContainerFailures{status: status.State.Termination}
|
||||
} else if status.LastTerminationState.Termination != nil {
|
||||
states[status.ContainerID] = ContainerFailures{status: status.LastTerminationState.Termination}
|
||||
if status.State.Terminated != nil {
|
||||
states[status.ContainerID] = ContainerFailures{status: status.State.Terminated}
|
||||
} else if status.LastTerminationState.Terminated != nil {
|
||||
states[status.ContainerID] = ContainerFailures{status: status.LastTerminationState.Terminated}
|
||||
}
|
||||
if status.RestartCount > 0 {
|
||||
var ok bool
|
||||
|
Reference in New Issue
Block a user