Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Olshevski committed Dec 11, 2023
1 parent 322523a commit 13869b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions internal/controllers/synthesis/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ func TestControllerHappyPath(t *testing.T) {

testutil.Eventually(t, func() bool {
require.NoError(t, cli.Get(ctx, client.ObjectKeyFromObject(comp), comp))
// TODO: Helper
return comp.Status.CurrentState != nil && comp.Status.CurrentState.ObservedSynthesizerGeneration == syn.Generation
})

Expand Down Expand Up @@ -202,7 +201,6 @@ func TestControllerSynthesizerRollout(t *testing.T) {
testutil.Eventually(t, func() bool {
require.NoError(t, client.IgnoreNotFound(cli.Get(ctx, client.ObjectKeyFromObject(comp1), comp1)))
require.NoError(t, client.IgnoreNotFound(cli.Get(ctx, client.ObjectKeyFromObject(comp2), comp2)))
// TODO: Helper func
inSync1 := comp1.Status.CurrentState != nil && comp1.Status.CurrentState.ObservedSynthesizerGeneration == syn.Generation
inSync2 := comp2.Status.CurrentState != nil && comp2.Status.CurrentState.ObservedSynthesizerGeneration == syn.Generation
return inSync1 && inSync2
Expand Down
2 changes: 2 additions & 0 deletions internal/controllers/synthesis/lifecycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ func (c *podLifecycleController) podStatusTerminal(pod *corev1.Pod) (string, boo
}

func swapStates(syn *apiv1.Synthesizer, comp *apiv1.Composition) {
// TODO: Block swapping prev->current if the any resources present in prev but absent in current have not yet been reconciled
// This will ensure that we don't orphan resources
comp.Status.PreviousState = comp.Status.CurrentState
comp.Status.CurrentState = &apiv1.Synthesis{
ObservedCompositionGeneration: comp.Generation,
Expand Down

0 comments on commit 13869b1

Please sign in to comment.