Skip to content

Commit

Permalink
Apply the object before setting status conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Nov 26, 2024
1 parent cfbf4a8 commit c12e320
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/utils/termination/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ var _ = Describe("TerminationUtils", func() {
cloudProvider.CreatedNodeClaims[nodeClaim.Status.ProviderID] = nodeClaim
})
It("should not call cloudProvider Delete if the status condition is already Terminating", func() {
// Apply the object to set the CreationTimestamp
ExpectApplied(ctx, env.Client, nodeClaim)

nodeClaim.StatusConditions().SetTrue(v1.ConditionTypeInstanceTerminating)
ExpectApplied(ctx, env.Client, nodeClaim)
instanceTerminated, err := termination.EnsureTerminated(ctx, env.Client, nodeClaim, cloudProvider)
Expand Down

0 comments on commit c12e320

Please sign in to comment.