From 92e6f793ded6950fe30f72b622102caf81d23b2a Mon Sep 17 00:00:00 2001 From: ste Date: Sat, 28 Dec 2024 00:47:38 +0100 Subject: [PATCH 1/3] fix: Invalid if condition --- controllers/controller_shared.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/controller_shared.go b/controllers/controller_shared.go index 8c112737d..82eedcf7b 100644 --- a/controllers/controller_shared.go +++ b/controllers/controller_shared.go @@ -102,7 +102,7 @@ func GetScopedMatchingInstances(log logr.Logger, ctx context.Context, k8sClient } selectedList = append(selectedList, instance) } - if len(unready_instances) > 1 { + if len(unready_instances) > 0 { log.Info("Grafana instances not ready", "instances", unready_instances) } From 55a0f3b24a551a57de9da8a90035258b5b4abe61 Mon Sep 17 00:00:00 2001 From: ste Date: Sat, 28 Dec 2024 00:48:50 +0100 Subject: [PATCH 2/3] fix: r.Log is undefined resulting in missing logs --- controllers/grafana_controller.go | 1 + 1 file changed, 1 insertion(+) diff --git a/controllers/grafana_controller.go b/controllers/grafana_controller.go index 59a075c6f..6c5ff25b3 100644 --- a/controllers/grafana_controller.go +++ b/controllers/grafana_controller.go @@ -69,6 +69,7 @@ type GrafanaReconciler struct { func (r *GrafanaReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { controllerLog := log.FromContext(ctx).WithName("GrafanaReconciler") + r.Log = controllerLog grafana := &grafanav1beta1.Grafana{} err := r.Get(ctx, req.NamespacedName, grafana) From 6cb750f43f2c879c9be0c8ce691a0ccff57ac903 Mon Sep 17 00:00:00 2001 From: ste Date: Sat, 28 Dec 2024 00:59:41 +0100 Subject: [PATCH 3/3] chore: Remove ResyncPeriodHasElapsed requirement on CommonResource --- api/v1beta1/common.go | 1 - 1 file changed, 1 deletion(-) diff --git a/api/v1beta1/common.go b/api/v1beta1/common.go index 621bd260e..a9d69500b 100644 --- a/api/v1beta1/common.go +++ b/api/v1beta1/common.go @@ -49,7 +49,6 @@ type CommonResource interface { MatchLabels() *metav1.LabelSelector MatchNamespace() string AllowCrossNamespace() bool - ResyncPeriodHasElapsed() bool } // The most recent observed state of a Grafana resource