pod gc controller sets status.observedGeneration upon pod failure

This commit is contained in:
Natasha Sarkar 2025-03-03 21:42:39 +00:00
parent 40e7d88f02
commit 701b76f10d

View File

@ -348,6 +348,7 @@ func (gcc *PodGCController) markFailedAndDeletePodWithCondition(ctx context.Cont
if pod.Status.Phase != v1.PodSucceeded && pod.Status.Phase != v1.PodFailed {
newStatus := pod.Status.DeepCopy()
newStatus.Phase = v1.PodFailed
newStatus.ObservedGeneration = apipod.GetPodObservedGenerationIfEnabled(pod)
if condition != nil {
apipod.UpdatePodCondition(newStatus, condition)
}