Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.1.15-dev
v0.1.16
4 changes: 2 additions & 2 deletions charts/control-plane-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: control-plane-operator
description: A Helm chart for the Cloud Orchestration Control Plane Operator
type: application
version: v0.1.15
appVersion: v0.1.15
version: v0.1.16
appVersion: v0.1.16
home: https://github.com/openmcp-project/control-plane-operator
sources:
- https://github.com/openmcp-project/control-plane-operator
2 changes: 1 addition & 1 deletion charts/control-plane-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ image:
repository: ghcr.io/openmcp-project/images/control-plane-operator
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: v0.1.15
tag: v0.1.16

imagePullSecrets: []
nameOverride: ""
Expand Down
5 changes: 5 additions & 0 deletions internal/controller/controlplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ import (
"k8s.io/client-go/tools/record"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/reconcile"

corev1beta1 "github.com/openmcp-project/control-plane-operator/api/v1beta1"
"github.com/openmcp-project/control-plane-operator/pkg/controlplane/components"
Expand Down Expand Up @@ -191,6 +193,9 @@ func (r *ControlPlaneReconciler) getReleaseChannels(ctx context.Context) corev1b
func (r *ControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&corev1beta1.ControlPlane{}).
WithOptions(controller.TypedOptions[reconcile.Request]{
MaxConcurrentReconciles: 10,
}).
Complete(r)
}

Expand Down
7 changes: 6 additions & 1 deletion internal/controller/kubeconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ func (r *ControlPlaneReconciler) ensureKubeconfig(ctx context.Context, remoteCfg
return nil, err
}

remainingLifetime := time.Until(expiration)

// check if token would expire before next planned reconciliation
if time.Now().Before(expiration.Add(-r.ReconcilePeriod)) {
// or less than a third of the desired lifetime is left
expired := remainingLifetime < r.ReconcilePeriod || remainingLifetime < r.FluxTokenLifetime/3

if !expired {
// kubeconfig is still valid
return &corev1.SecretReference{Name: secret.Name, Namespace: secret.Namespace}, nil
}
Expand Down
Loading