From 7330b670493f11b3a1045b66ed00535e2f945bee Mon Sep 17 00:00:00 2001 From: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> Date: Wed, 26 Jun 2024 16:06:54 +0200 Subject: [PATCH] post rebase fix Signed-off-by: Thibault Mange <22740367+thibaultmg@users.noreply.github.com> --- .../observabilityendpoint/observabilityaddon_controller.go | 3 +-- operators/endpointmetrics/pkg/status/status.go | 2 ++ operators/endpointmetrics/pkg/status/status_test.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/operators/endpointmetrics/controllers/observabilityendpoint/observabilityaddon_controller.go b/operators/endpointmetrics/controllers/observabilityendpoint/observabilityaddon_controller.go index c9ae06226..fddbd1d77 100644 --- a/operators/endpointmetrics/controllers/observabilityendpoint/observabilityaddon_controller.go +++ b/operators/endpointmetrics/controllers/observabilityendpoint/observabilityaddon_controller.go @@ -214,8 +214,7 @@ func (r *ObservabilityAddonReconciler) Reconcile(ctx context.Context, req ctrl.R clusterType = operatorconfig.OcpThreeClusterType } - isSNO, err := openshift.IsSNO(ctx, r.Client) - if err != nil { + if isSNO, err := openshift.IsSNO(ctx, r.Client); err != nil { log.Error(err, "Failed to check if the cluster is SNO") } else if isSNO { clusterType = operatorconfig.SnoClusterType diff --git a/operators/endpointmetrics/pkg/status/status.go b/operators/endpointmetrics/pkg/status/status.go index 881d1f7cb..b6e39a587 100644 --- a/operators/endpointmetrics/pkg/status/status.go +++ b/operators/endpointmetrics/pkg/status/status.go @@ -14,6 +14,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/util/retry" + ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -54,6 +55,7 @@ var ( Status: metav1.ConditionTrue, }, } + log = ctrl.Log.WithName("status") ) func ReportStatus(ctx context.Context, client client.Client, conditionReason ConditionReason, addonName, addonNs string) error { diff --git a/operators/endpointmetrics/pkg/status/status_test.go b/operators/endpointmetrics/pkg/status/status_test.go index dc497b755..d5227448a 100644 --- a/operators/endpointmetrics/pkg/status/status_test.go +++ b/operators/endpointmetrics/pkg/status/status_test.go @@ -164,7 +164,7 @@ func TestReportStatus(t *testing.T) { {Type: "Degraded", Status: metav1.ConditionTrue}, {Type: "Available", Status: metav1.ConditionTrue}, }, - newCondition: util.Deployed, + newCondition: status.Deployed, expects: func(t *testing.T, conditions []oav1beta1.StatusCondition) { assert.Len(t, conditions, 3) for _, c := range conditions {