From 21e2a475ca977cd52d761c56b42a270c996239a9 Mon Sep 17 00:00:00 2001 From: QuentinBisson Date: Wed, 27 Nov 2024 10:17:09 +0100 Subject: [PATCH] get rid of mtp in favor of an ingress --- main.go | 6 ++++++ pkg/resource/logging-secret/reconciler.go | 9 +++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index d00fc51b..82d87cb9 100644 --- a/main.go +++ b/main.go @@ -49,6 +49,7 @@ import ( loggingcredentials "github.com/giantswarm/logging-operator/pkg/resource/logging-credentials" loggingsecret "github.com/giantswarm/logging-operator/pkg/resource/logging-secret" loggingwiring "github.com/giantswarm/logging-operator/pkg/resource/logging-wiring" + lokiingressauthsecret "github.com/giantswarm/logging-operator/pkg/resource/loki-ingress-auth-secret" proxyauth "github.com/giantswarm/logging-operator/pkg/resource/proxy-auth" //+kubebuilder:scaffold:imports ) @@ -158,6 +159,10 @@ func main() { Client: mgr.GetClient(), } + lokiIngressAuthSecret := lokiingressauthsecret.Reconciler{ + Client: mgr.GetClient(), + } + loggingSecret := loggingsecret.Reconciler{ Client: mgr.GetClient(), } @@ -191,6 +196,7 @@ func main() { &loggingWiring, &loggingSecrets, &grafanaDatasource, + &lokiIngressAuthSecret, &proxyAuth, &loggingSecret, &loggingConfig, diff --git a/pkg/resource/logging-secret/reconciler.go b/pkg/resource/logging-secret/reconciler.go index a7aa408f..831224ae 100644 --- a/pkg/resource/logging-secret/reconciler.go +++ b/pkg/resource/logging-secret/reconciler.go @@ -30,12 +30,9 @@ func (r *Reconciler) ReconcileCreate(ctx context.Context, lc loggedcluster.Inter logger.Info("logging-secret create") // Retrieve secret containing credentials - var objectKey = types.NamespacedName{ - Name: loggingcredentials.LoggingCredentialsSecretMeta().Name, - Namespace: loggingcredentials.LoggingCredentialsSecretMeta().Namespace, - } var loggingCredentialsSecret v1.Secret - err := r.Client.Get(ctx, objectKey, &loggingCredentialsSecret) + err := r.Client.Get(ctx, types.NamespacedName{Name: loggingcredentials.LoggingCredentialsSecretMeta().Name, Namespace: loggingcredentials.LoggingCredentialsSecretMeta().Namespace}, + &loggingCredentialsSecret) if err != nil { return ctrl.Result{}, errors.WithStack(err) } @@ -56,7 +53,7 @@ func (r *Reconciler) ReconcileCreate(ctx context.Context, lc loggedcluster.Inter // Check if secret already exists. logger.Info("logging-secret - getting", "namespace", desiredLoggingSecret.GetNamespace(), "name", desiredLoggingSecret.GetName()) var currentLoggingSecret v1.Secret - err = r.Client.Get(ctx, objectKey, ¤tLoggingSecret) + err = r.Client.Get(ctx, types.NamespacedName{Name: desiredLoggingSecret.GetName(), Namespace: desiredLoggingSecret.GetNamespace()}, ¤tLoggingSecret) if err != nil { if apimachineryerrors.IsNotFound(err) { logger.Info("logging-secret not found, creating")