From 2307a36503d357edd595706c1ec9dfea101b6076 Mon Sep 17 00:00:00 2001 From: mblos Date: Thu, 7 May 2026 16:13:17 +0200 Subject: [PATCH] fix: CR syncer --- cmd/manager/main.go | 2 +- helm/bundles/cortex-nova/values.yaml | 1 + internal/scheduling/reservations/commitments/syncer.go | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 687c0e869..6c1096512 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -848,7 +848,7 @@ func main() { syncerConfig := conf.GetConfigOrDie[commitments.SyncerConfig]() if err := (&task.Runner{ Client: multiclusterClient, - Interval: syncerConfig.SyncInterval, + Interval: syncerConfig.SyncInterval.Duration, Name: "commitments-sync-task", Run: func(ctx context.Context) error { return syncer.SyncReservations(ctx) }, Init: func(ctx context.Context) error { return syncer.Init(ctx, syncerConfig) }, diff --git a/helm/bundles/cortex-nova/values.yaml b/helm/bundles/cortex-nova/values.yaml index cf218766d..65ce2ddde 100644 --- a/helm/bundles/cortex-nova/values.yaml +++ b/helm/bundles/cortex-nova/values.yaml @@ -144,6 +144,7 @@ cortex-scheduling-controllers: capacityReconcileInterval: 5m enabledTasks: - nova-history-cleanup-task + - commitments-sync-task # If true, the external scheduler API will limit the list of hosts in its # response to those included in the scheduling request. novaLimitHostsToRequest: true diff --git a/internal/scheduling/reservations/commitments/syncer.go b/internal/scheduling/reservations/commitments/syncer.go index dc10e21b9..7c96823d0 100644 --- a/internal/scheduling/reservations/commitments/syncer.go +++ b/internal/scheduling/reservations/commitments/syncer.go @@ -35,7 +35,7 @@ type SyncerConfig struct { // Secret ref to SSO credentials stored in a k8s secret, if applicable. SSOSecretRef *corev1.SecretReference `json:"ssoSecretRef"` // SyncInterval defines how often the syncer reconciles Limes commitments to Reservation CRDs. - SyncInterval time.Duration `json:"committedResourceSyncInterval"` + SyncInterval metav1.Duration `json:"committedResourceSyncInterval"` } type Syncer struct { @@ -58,7 +58,7 @@ func NewSyncer(k8sClient client.Client, monitor *SyncerMonitor) *Syncer { } func (s *Syncer) Init(ctx context.Context, config SyncerConfig) error { - s.syncInterval = config.SyncInterval + s.syncInterval = config.SyncInterval.Duration if err := s.CommitmentsClient.Init(ctx, s.Client, config); err != nil { return err }