Skip to content

Commit

Permalink
Merge pull request metallb#175 from liornoy/cherry-pick-172-to-releas…
Browse files Browse the repository at this point in the history
…e-4.11

[release-4.11] OCPBUGS-15567: Fix metallb controller error log
  • Loading branch information
openshift-merge-robot authored Jun 30, 2023
2 parents 0f69a1e + 4640d2e commit 6333729
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/metallb_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (r *MetalLBReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
}
}
if err := status.Update(context.TODO(), r.Client, instance, condition, errorMsg, wrappedErrMsg); err != nil {
logger.Info("Failed to update metallb status", "Desired status", status.ConditionAvailable)
logger.Error(err, "Failed to update metallb status", "Desired status", status.ConditionAvailable)
}
}
return result, err
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/functional/tests/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var _ = Describe("metallb", func() {
Expect(daemonset.OwnerReferences).ToNot(BeNil())
Expect(daemonset.OwnerReferences[0].Kind).To(Equal("MetalLB"))

metallbutils.Delete(metallb)
metallbutils.DeleteAndCheck(metallb)
}
})

Expand Down Expand Up @@ -195,7 +195,7 @@ var _ = Describe("metallb", func() {

AfterEach(func() {
metallbutils.Delete(incorrect_metallb)
metallbutils.Delete(correct_metallb)
metallbutils.DeleteAndCheck(correct_metallb)
})
It("should have correct statuses", func() {
By("checking MetalLB resource status", func() {
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/metallb/metallb.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func Delete(metallb *metallbv1beta1.MetalLB) {
return
}
Expect(err).ToNot(HaveOccurred())
}

func DeleteAndCheck(metallb *metallbv1beta1.MetalLB) {
Delete(metallb)

Eventually(func() bool {
err := testclient.Client.Get(context.Background(), goclient.ObjectKey{Namespace: metallb.Namespace, Name: metallb.Name}, metallb)
Expand Down

0 comments on commit 6333729

Please sign in to comment.