From daad05472690d3d2ebbd5920be28b4b2252a5361 Mon Sep 17 00:00:00 2001 From: Jordan Olshevski Date: Thu, 7 Dec 2023 15:10:08 -0600 Subject: [PATCH] Remove old swap logic --- internal/controllers/synthesis/lifecycle.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/controllers/synthesis/lifecycle.go b/internal/controllers/synthesis/lifecycle.go index b5518ac9..ba1de5d6 100644 --- a/internal/controllers/synthesis/lifecycle.go +++ b/internal/controllers/synthesis/lifecycle.go @@ -185,12 +185,7 @@ func (c *podLifecycleController) podStatusTerminal(pod *corev1.Pod) (string, boo } func swapStates(syn *apiv1.Synthesizer, comp *apiv1.Composition) { - // Only swap current->previous when the current synthesis has completed - // This avoids losing the prior state during rapid updates to the composition - resourceSliceCountSet := comp.Status.CurrentState != nil && comp.Status.CurrentState.ResourceSliceCount != nil - if resourceSliceCountSet { - comp.Status.PreviousState = comp.Status.CurrentState - } + comp.Status.PreviousState = comp.Status.CurrentState comp.Status.CurrentState = &apiv1.Synthesis{ ObservedCompositionGeneration: comp.Generation, }