Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Invalid if condition in GetScopedMatchingInstances when only 1 instance is unready #1804

Merged
merged 3 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion api/v1beta1/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion controllers/controller_shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
1 change: 1 addition & 0 deletions controllers/grafana_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading