Skip to content

Commit

Permalink
Skip deleted pods
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Olshevski committed Dec 12, 2023
1 parent 62539b7 commit 74a9265
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ func NewPodController(t testing.TB, mgr ctrl.Manager, fn func(*apiv1.Composition
for _, pod := range pods.Items {
pod := pod

if pod.DeletionTimestamp != nil {
continue // pod no longer exists
}

// The real pod controller will ignore outdated (probably deleting) pods
compGen, _ := strconv.ParseInt(pod.Annotations["eno.azure.io/composition-generation"], 10, 0)
synGen, _ := strconv.ParseInt(pod.Annotations["eno.azure.io/synthesizer-generation"], 10, 0)
Expand All @@ -250,6 +254,7 @@ func NewPodController(t testing.TB, mgr ctrl.Manager, fn func(*apiv1.Composition

// Write all of the resource slices, update the resource slice count accordingly
// TODO: We need a controller to remove failed/outdated resource slice writes
// TODO: Do we have immutable validation on the CRD?
if comp.Status.CurrentState.ResourceSliceCount == nil {
for _, slice := range slices {
cp := slice.DeepCopy()
Expand Down

0 comments on commit 74a9265

Please sign in to comment.