From c1dcf37a60783da8469c28c04b7cec2b74c9f2a2 Mon Sep 17 00:00:00 2001 From: Jean Baudin Date: Wed, 7 Aug 2024 12:29:56 +0200 Subject: [PATCH] fix: allow using a different namespace for the auth --- pkg/controller/configuration/ensure.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/controller/configuration/ensure.go b/pkg/controller/configuration/ensure.go index 4ec011a05..9a181f620 100644 --- a/pkg/controller/configuration/ensure.go +++ b/pkg/controller/configuration/ensure.go @@ -452,7 +452,12 @@ func (c *Controller) ensureAuthenticationSecret(configuration *terraformv1alpha1 } secret := &v1.Secret{} - secret.Namespace = configuration.Namespace + if configuration.Spec.Auth.Namespace == "" { + secret.Namespace = configuration.Namespace + } else { + secret.Namespace = configuration.Spec.Auth.Namespace + } + secret.Name = configuration.Spec.Auth.Name found, err := kubernetes.GetIfExists(ctx, c.cc, secret)