Skip to content

Commit

Permalink
removed unused function
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumEnigmaa committed May 20, 2024
1 parent 268f75c commit 537b372
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions pkg/monitoring/mimir/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,13 @@ package mimir
import (
"context"
"fmt"
"log"

"github.com/giantswarm/observability-operator/pkg/monitoring/prometheusagent"
corev1 "k8s.io/api/core/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
)

// Checks whether Mimir is enabled in the cluster by listing the pods in the Mimir namespace.
func IsMimirEnabled(ctx context.Context) bool {
cfg, err := config.GetConfig()
if err != nil {
log.Fatal(err)
}

c, err := client.New(cfg, client.Options{})
if err != nil {
log.Fatal(err)
}

mimirPods := &corev1.PodList{}
err = c.List(ctx, mimirPods, client.InNamespace("mimir"))

if err != nil {
log.Fatal("error getting pods: %v\n", err)
}

// If pods were found in the mimir namespace, this means that mimir is running.
return len(mimirPods.Items) > 0
}

func GetMimirIngressPassword(ctx context.Context, mc string) (string, error) {
cfg, err := config.GetConfig()
if err != nil {
Expand Down

0 comments on commit 537b372

Please sign in to comment.