From 2465cb43bd1b327ae3fde1a2b0c61298eea34cfb Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 18 Sep 2023 12:54:08 +0200 Subject: [PATCH] controller: use `DefaultServiceAccount` in differ This addresses an issue in which the defunct `DefaultServiceAccount` from the `HelmReleaseReconciler` was being used to construct the impersonator used by the differ. Signed-off-by: Hidde Beydals --- internal/controller/helmrelease_controller.go | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/internal/controller/helmrelease_controller.go b/internal/controller/helmrelease_controller.go index fa96e5cac..5b724da9b 100644 --- a/internal/controller/helmrelease_controller.go +++ b/internal/controller/helmrelease_controller.go @@ -79,16 +79,15 @@ type HelmReleaseReconciler struct { client.Client helper.Metrics - Config *rest.Config - Scheme *runtime.Scheme - EventRecorder kuberecorder.EventRecorder - DefaultServiceAccount string - NoCrossNamespaceRef bool - ClientOpts runtimeClient.Options - KubeConfigOpts runtimeClient.KubeConfigOptions - StatusPoller *polling.StatusPoller - PollingOpts polling.Options - ControllerName string + Config *rest.Config + Scheme *runtime.Scheme + EventRecorder kuberecorder.EventRecorder + NoCrossNamespaceRef bool + ClientOpts runtimeClient.Options + KubeConfigOpts runtimeClient.KubeConfigOptions + StatusPoller *polling.StatusPoller + PollingOpts polling.Options + ControllerName string httpClient *retryablehttp.Client requeueDependency time.Duration @@ -325,7 +324,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, r.PollingOpts, hr.Spec.KubeConfig, r.KubeConfigOpts, - r.DefaultServiceAccount, + kube.DefaultServiceAccountName, hr.Spec.ServiceAccountName, hr.GetNamespace(), ), r.ControllerName)