From 7e0ffc0dc7659a515435af6bf12a2eb57bef85e6 Mon Sep 17 00:00:00 2001 From: QuentinBisson Date: Mon, 25 Nov 2024 14:53:45 +0100 Subject: [PATCH] change from isCapi to GetTenant --- pkg/logged-cluster/vintagemc/cluster.go | 4 ---- pkg/logged-cluster/vintagewc/cluster.go | 4 ---- pkg/resource/proxy-auth/proxy-auth.go | 7 +------ 3 files changed, 1 insertion(+), 14 deletions(-) diff --git a/pkg/logged-cluster/vintagemc/cluster.go b/pkg/logged-cluster/vintagemc/cluster.go index 92054269..cd618797 100644 --- a/pkg/logged-cluster/vintagemc/cluster.go +++ b/pkg/logged-cluster/vintagemc/cluster.go @@ -13,10 +13,6 @@ type Object struct { Options loggedcluster.Options } -func (o Object) IsCAPI() bool { - return false -} - func (o Object) HasLoggingEnabled() bool { return o.Options.EnableLoggingFlag } diff --git a/pkg/logged-cluster/vintagewc/cluster.go b/pkg/logged-cluster/vintagewc/cluster.go index 81ada0cc..2494a2fd 100644 --- a/pkg/logged-cluster/vintagewc/cluster.go +++ b/pkg/logged-cluster/vintagewc/cluster.go @@ -44,10 +44,6 @@ func (o Object) HasLoggingEnabled() bool { return loggingEnabled } -func (o Object) IsCAPI() bool { - return false -} - func (o Object) GetLoggingAgent() string { return o.Options.LoggingAgent } diff --git a/pkg/resource/proxy-auth/proxy-auth.go b/pkg/resource/proxy-auth/proxy-auth.go index 2b3b8634..a3205c42 100644 --- a/pkg/resource/proxy-auth/proxy-auth.go +++ b/pkg/resource/proxy-auth/proxy-auth.go @@ -67,17 +67,12 @@ func GenerateProxyAuthSecret(lc loggedcluster.Interface, credentialsSecret *v1.S return v1.Secret{}, errors.WithStack(err) } - tenant := writeUser - if lc.IsCAPI() { - tenant = common.DefaultWriteTenant - } - authCfg.Users = append(authCfg.Users, config.User{ Username: writeUser, Password: writePassword, // we set the default tenant even though it may be given by the sender // depending of grafana-multi-teant-proxy config - OrgID: tenant, + OrgID: writeUser, }) // Add write user to allowed tenants for read user