From 9e755c98a004ca3e844a4f8a53ceb62f92684fd1 Mon Sep 17 00:00:00 2001 From: Jordan Olshevski Date: Wed, 6 Dec 2023 16:12:10 -0600 Subject: [PATCH] Sus but passing tests --- internal/reconstitution/cache.go | 2 ++ internal/testutil/testutil.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/reconstitution/cache.go b/internal/reconstitution/cache.go index 85b05f42..d6de1e72 100644 --- a/internal/reconstitution/cache.go +++ b/internal/reconstitution/cache.go @@ -14,6 +14,8 @@ import ( "github.com/go-logr/logr" ) +// TODO: Is it possible for resynthesization to ocurr without an update to the composition spec? + // cache maintains a fast index of (ResourceRef + Composition + Synthesis) -> Resource. type cache struct { client client.Client diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index f14881ab..ee4a2dec 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -248,7 +248,7 @@ func NewPodController(t testing.TB, mgr ctrl.Manager, fn func(*apiv1.Composition // Add resource slice count - the wrapper will do this in the real world pod := pods.Items[0] - if comp.Status.CurrentState.ResourceSliceCount == nil { + if comp.Status.CurrentState.ResourceSliceCount == nil || comp.Status.CurrentState.ObservedCompositionGeneration != comp.Generation || comp.Status.CurrentState.ObservedSynthesizerGeneration != syn.Generation { count := int64(len(slices)) comp.Status.CurrentState.ResourceSliceCount = &count err = cli.Status().Update(ctx, comp)