Skip to content

Commit

Permalink
test: ensure NodeClaim root condition reamains known during terminati…
Browse files Browse the repository at this point in the history
…on (#1845)
  • Loading branch information
jmdeal authored Nov 26, 2024
1 parent 6efbae4 commit c449e4e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/utils/termination/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,22 @@ var _ = Describe("TerminationUtils", func() {
Expect(instanceTerminated).To(BeTrue())
Expect(err).NotTo(HaveOccurred())
})
It("shouldn't mark the root condition of the NodeClaim as unknown when setting the Termination condition", func() {
for _, cond := range []string{
v1.ConditionTypeLaunched,
v1.ConditionTypeRegistered,
v1.ConditionTypeInitialized,
} {
nodeClaim.StatusConditions().SetTrue(cond)
}
ExpectApplied(ctx, env.Client, nodeClaim)
nodeClaim = ExpectExists(ctx, env.Client, nodeClaim)
Expect(nodeClaim.StatusConditions().Root().IsTrue())
ExpectApplied(ctx, env.Client, nodeClaim)
instanceTerminated, err := termination.EnsureTerminated(ctx, env.Client, nodeClaim, cloudProvider)
Expect(instanceTerminated).To(BeFalse())
Expect(err).NotTo(HaveOccurred())
Expect(nodeClaim.StatusConditions().Get(v1.ConditionTypeInstanceTerminating).IsTrue()).To(BeTrue())
Expect(nodeClaim.StatusConditions().Root().IsTrue())
})
})

0 comments on commit c449e4e

Please sign in to comment.