Skip to content

Commit 57066b7

Browse files
authored
test: refactor expectations to support karpenter project (#172)
* test: improve expectations to support karpenter project Signed-off-by: Ronaldo Lanhellas <[email protected]> * test: improve expectations to support karpenter project Signed-off-by: Ronaldo Lanhellas <[email protected]> --------- Signed-off-by: Ronaldo Lanhellas <[email protected]>
1 parent 4e7491c commit 57066b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/expectations/expectations.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ func expectCleanedUp(ctx context.Context, c client.Client, force bool, objectLis
224224
stored := item.DeepCopy()
225225
item.SetFinalizers([]string{})
226226
g.Expect(c.Patch(ctx, &item, client.MergeFrom(stored))).To(Succeed())
227-
}
228-
if item.GetDeletionTimestamp().IsZero() {
227+
g.Expect(client.IgnoreNotFound(c.Delete(ctx, &item, &client.DeleteOptions{GracePeriodSeconds: lo.ToPtr(int64(0))}))).To(Succeed())
228+
} else if item.GetDeletionTimestamp().IsZero() {
229229
g.Expect(client.IgnoreNotFound(c.Delete(ctx, &item, client.PropagationPolicy(metav1.DeletePropagationForeground), &client.DeleteOptions{GracePeriodSeconds: lo.ToPtr(int64(0))}))).To(Succeed())
230230
}
231231
}

0 commit comments

Comments
 (0)