Skip to content

Commit

Permalink
get rid of mtp in favor of an ingress
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinBisson committed Nov 27, 2024
1 parent b1fb295 commit 21e2a47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down Expand Up @@ -158,6 +159,10 @@ func main() {
Client: mgr.GetClient(),
}

lokiIngressAuthSecret := lokiingressauthsecret.Reconciler{
Client: mgr.GetClient(),
}

loggingSecret := loggingsecret.Reconciler{
Client: mgr.GetClient(),
}
Expand Down Expand Up @@ -191,6 +196,7 @@ func main() {
&loggingWiring,
&loggingSecrets,
&grafanaDatasource,
&lokiIngressAuthSecret,
&proxyAuth,
&loggingSecret,
&loggingConfig,
Expand Down
9 changes: 3 additions & 6 deletions pkg/resource/logging-secret/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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, &currentLoggingSecret)
err = r.Client.Get(ctx, types.NamespacedName{Name: desiredLoggingSecret.GetName(), Namespace: desiredLoggingSecret.GetNamespace()}, &currentLoggingSecret)
if err != nil {
if apimachineryerrors.IsNotFound(err) {
logger.Info("logging-secret not found, creating")
Expand Down

0 comments on commit 21e2a47

Please sign in to comment.