diff --git a/pkg/controllers/cluster/cluster_controller.go b/pkg/controllers/cluster/cluster_controller.go index abbb71cb..c44d865a 100644 --- a/pkg/controllers/cluster/cluster_controller.go +++ b/pkg/controllers/cluster/cluster_controller.go @@ -115,7 +115,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