Skip to content

Commit

Permalink
Remove old swap logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jveski committed Dec 7, 2023
1 parent bb1ea38 commit daad054
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions internal/controllers/synthesis/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down

0 comments on commit daad054

Please sign in to comment.