mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
pod gc controller sets status.observedGeneration upon pod failure
This commit is contained in:
parent
40e7d88f02
commit
701b76f10d
@ -348,6 +348,7 @@ func (gcc *PodGCController) markFailedAndDeletePodWithCondition(ctx context.Cont
|
|||||||
if pod.Status.Phase != v1.PodSucceeded && pod.Status.Phase != v1.PodFailed {
|
if pod.Status.Phase != v1.PodSucceeded && pod.Status.Phase != v1.PodFailed {
|
||||||
newStatus := pod.Status.DeepCopy()
|
newStatus := pod.Status.DeepCopy()
|
||||||
newStatus.Phase = v1.PodFailed
|
newStatus.Phase = v1.PodFailed
|
||||||
|
newStatus.ObservedGeneration = apipod.GetPodObservedGenerationIfEnabled(pod)
|
||||||
if condition != nil {
|
if condition != nil {
|
||||||
apipod.UpdatePodCondition(newStatus, condition)
|
apipod.UpdatePodCondition(newStatus, condition)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user