From 0fb61c31160bb9da2620db8ac4a7b6768edcdfb9 Mon Sep 17 00:00:00 2001 From: googs1025 Date: Fri, 13 Dec 2024 13:19:49 +0800 Subject: [PATCH] use constant variables in Reconciled Signed-off-by: googs1025 --- controllers/nvidiadriver_controller.go | 2 +- internal/conditions/conditions_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/nvidiadriver_controller.go b/controllers/nvidiadriver_controller.go index 90734b143..e11b361ee 100644 --- a/controllers/nvidiadriver_controller.go +++ b/controllers/nvidiadriver_controller.go @@ -200,7 +200,7 @@ func (r *NVIDIADriverReconciler) Reconcile(ctx context.Context, req ctrl.Request return reconcile.Result{RequeueAfter: time.Second * 5}, nil } - if condErr = r.conditionUpdater.SetConditionsReady(ctx, instance, "Reconciled", "All resources have been successfully reconciled"); condErr != nil { + if condErr = r.conditionUpdater.SetConditionsReady(ctx, instance, conditions.Reconciled, "All resources have been successfully reconciled"); condErr != nil { return ctrl.Result{}, condErr } return reconcile.Result{}, nil diff --git a/internal/conditions/conditions_test.go b/internal/conditions/conditions_test.go index 6d811d09e..df2e4565a 100644 --- a/internal/conditions/conditions_test.go +++ b/internal/conditions/conditions_test.go @@ -53,7 +53,7 @@ func TestConditionsUpdater_SetConditionsReady(t *testing.T) { Reason: "Ready", } - err := u.SetConditionsReady(context.Background(), driver, "Reconciled", "All resources are successfully reconciled") + err := u.SetConditionsReady(context.Background(), driver, Reconciled, "All resources are successfully reconciled") assert.NoError(t, err) instance := &nvidiav1alpha1.NVIDIADriver{}