operator-sdk icon indicating copy to clipboard operation
operator-sdk copied to clipboard

SyncPeriod for controllers

Open IshaanDesai45 opened this issue 10 months ago • 1 comments

Hey I want to set a reconcile on one of my controller at regular intervals of time. Going through the issues I found out that it can be done via syncPeriod manager option. But when I refer to this doc https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/manager?utm_source=godoc#Options I don't see any SyncPeriod attribute. So is it deprecated ? if yes then what is the way to acheive this ?

IshaanDesai45 avatar Apr 02 '24 08:04 IshaanDesai45

Hi @IshaanDesai45 - thanks for filing this issue!

I think the manager.Options type has been updated and there is not a direct SyncPeriod field anymore. Instead it should be set via the manager.Options.Cache.SyncPeriod field.

See: https://github.com/kubernetes-sigs/controller-runtime/blob/v0.17.2/pkg/cache/cache.go#L136

I hope this helps!

everettraven avatar Apr 02 '24 09:04 everettraven