Skip to content

Commit

Permalink
Minor fix
Browse files Browse the repository at this point in the history
Signed-off-by: Aniruddha Basak <[email protected]>
  • Loading branch information
aniruddha2000 committed Oct 12, 2023
1 parent d29991e commit eb36373
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion controllers/hcloudremediation_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ var _ = Describe("HCloudRemediationReconciler", func() {
}, timeout).Should(BeTrue())
})

It("checks if hcloudRemediation is in deleting phase and capiMachine has MachineOwnerRemediatedCondition if lastRemediated is too long ago", func() {
It("should delete machine if remediation is unhealthy", func() {
By("creating hcloudRemediation")
Expect(testEnv.Create(ctx, hcloudRemediation)).To(Succeed())

Expand Down
8 changes: 4 additions & 4 deletions controllers/hetznerbaremetalremediation_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() {
Expect(testEnv.Cleanup(ctx, hetznerBareMetalRemediation, hetznerBaremetalMachine)).To(Succeed())
})

It("Should set MachineOwnerRemediatedCondition on capiMachine as there is no host annotation on hetznerBaremetalMachine", func() {
It("should not remediate if no annotations is present in the hetznerBaremetalMachine", func() {
Expect(testEnv.Create(ctx, hetznerBaremetalMachine)).To(Succeed())
Expect(testEnv.Create(ctx, hetznerBareMetalRemediation)).To(Succeed())

Expand All @@ -271,11 +271,10 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() {
}, timeout).Should(BeTrue())
})

It("Should set MachineOwnerRemediatedCondition on capiMachine if no HetznerBareMetalHost present", func() {
It("should not remediate if no HetznerBareMetalHost is present", func() {
hetznerBaremetalMachine.Annotations = map[string]string{
infrav1.HostAnnotation: fmt.Sprintf("%s/%s", testNs.Name, hostName),
}

Expect(testEnv.Create(ctx, hetznerBaremetalMachine)).To(Succeed())
Expect(testEnv.Create(ctx, hetznerBareMetalRemediation)).To(Succeed())

Expand Down Expand Up @@ -331,7 +330,7 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() {
}, timeout).Should(BeNil())
})

It("should remediate host", func() {
It("checks that, under normal conditions, reboot annotation, retryCount and lastRemediated are set", func() {
By("creating hetznerBareMetalRemediation object")
Expect(testEnv.Create(ctx, hetznerBareMetalRemediation)).To(Succeed())

Expand Down Expand Up @@ -415,6 +414,7 @@ var _ = Describe("HetznerBareMetalRemediationReconciler", func() {
By("creating hetznerBareMetalRemediation object")
Expect(testEnv.Create(ctx, hetznerBareMetalRemediation)).To(Succeed())

By("checking if capiMachine has the MachineOwnerRemediatedCondition")
Eventually(func() bool {
if err := testEnv.Get(ctx, capiMachineKey, capiMachine); err != nil {
return false
Expand Down

0 comments on commit eb36373

Please sign in to comment.