From 6b94f5d678a52fd0d04a434374fca0d739d86b63 Mon Sep 17 00:00:00 2001 From: QuantumEnigmaa Date: Tue, 21 May 2024 09:16:49 +0200 Subject: [PATCH] small enhancements --- pkg/monitoring/mimir/service.go | 13 +++++++++---- pkg/monitoring/mimir/utils.go | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pkg/monitoring/mimir/service.go b/pkg/monitoring/mimir/service.go index 7b8b7575..c603afdd 100644 --- a/pkg/monitoring/mimir/service.go +++ b/pkg/monitoring/mimir/service.go @@ -19,6 +19,11 @@ type MimirService struct { client.Client } +const ( + ingressSecretName = "mimir-gateway-ingress" + ingressSecretNamespace = "mimir" +) + func (ms *MimirService) ReconcileMimirConfig(ctx context.Context, mc string) error { logger := log.FromContext(ctx).WithValues("cluster", mc) logger.Info("ensuring mimir config") @@ -36,8 +41,8 @@ func (ms *MimirService) ReconcileMimirConfig(ctx context.Context, mc string) err func (ms *MimirService) CreateOrUpdateIngressSecret(ctx context.Context, mc string, logger logr.Logger) error { objectKey := client.ObjectKey{ - Name: "mimir-gateway-ingress", - Namespace: "mimir", + Name: ingressSecretName, + Namespace: ingressSecretNamespace, } current := &corev1.Secret{} @@ -89,8 +94,8 @@ func (ms *MimirService) CreateOrUpdateIngressSecret(ctx context.Context, mc stri func (ms *MimirService) DeleteIngressSecret(ctx context.Context) error { objectKey := client.ObjectKey{ - Name: "mimir-gateway-ingress", - Namespace: "mimir", + Name: ingressSecretName, + Namespace: ingressSecretNamespace, } current := &corev1.Secret{} // Get the current secret if it exists. diff --git a/pkg/monitoring/mimir/utils.go b/pkg/monitoring/mimir/utils.go index 2240278f..09ccc804 100644 --- a/pkg/monitoring/mimir/utils.go +++ b/pkg/monitoring/mimir/utils.go @@ -26,7 +26,7 @@ func GetMimirIngressPassword(ctx context.Context, mc string) (string, error) { err = c.Get(ctx, client.ObjectKey{ Name: fmt.Sprintf("%s-remote-write-secret", mc), - Namespace: "org-giantswarm", + Namespace: "org-gintswarm", }, secret) if err != nil { return "", err