From 67c25654a049be0a4e81d589b8e57f51d5391212 Mon Sep 17 00:00:00 2001 From: grzegorz-ciezkowski Date: Mon, 28 Oct 2024 10:18:01 +0100 Subject: [PATCH] feat(clusters) RenewRemoteClusterBearerTokenAfter to current value in reconciler --- pkg/controllers/cluster/cluster_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/cluster/cluster_controller.go b/pkg/controllers/cluster/cluster_controller.go index 8d68025a..4af3d3bd 100644 --- a/pkg/controllers/cluster/cluster_controller.go +++ b/pkg/controllers/cluster/cluster_controller.go @@ -114,7 +114,7 @@ func (r *RemoteClusterReconciler) EnsureCreated(ctx context.Context, resource li var tokenRequest = &tokenHelper{ Client: r.Client, RemoteClusterBearerTokenValidity: time.Duration(cluster.Spec.KubeConfig.MaxTokenValidity) * time.Hour, - RenewRemoteClusterBearerTokenAfter: (time.Duration(cluster.Spec.KubeConfig.MaxTokenValidity) * time.Hour) - (24 * time.Hour), + RenewRemoteClusterBearerTokenAfter: r.RenewRemoteClusterBearerTokenAfter, } if err := tokenRequest.ReconcileServiceAccountToken(ctx, restClientGetter, cluster); err != nil { return ctrl.Result{}, lifecycle.Failed, err