operator-framework / operator-framework/java-operator-sdk
Reconciler with enabled "generationAwareEventProcessing" reconciles unchanged custom resource upon startup
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 944
- Fork
- 242
- Merge medio
- 1g 4h
- PR unite (30g)
- 43
Descrizione
Bug Report
What did you do?
Hello,
We've encountered the behavior where we're using the default Reconciler settings, which has generationAwareEventProcessing turned on as well as a default maxReconciliationInterval set to 10 hours. Our CR implements the ObservedGenerationAwareStatus interface, so it has the observedGeneration property present in the status and it's handled by the framework.
We're seeing that upon Operator startup a reconciliation is triggered, when there is an already created custom resource in the cluster which has been reconciled already and has metadata.generation equal to status.observedGenertion.
The problem in this scenario is that the Operator is being updated and has updated logic, triggered by a pipeline automation script update. An update to the CR is going to follow in the next pipeline step. However, the triggered reconciliation captures the current CR in the cluster before the updated one can be applied. That in some cases leads to breaking dependent resources spec and subsequent failure (e.g. old incompatible images read from the CR set to an updated Deployment dependent resources spec encoded in the Operator code).
What did you expect to see?
No reconciliation triggered on the CR, which has it's generation and observed generation matching properties.
Environment
Kubernetes cluster type:
Gardener K8s 1.33.5
java-operator-sdk version is 4.4.4
Java version 17
Possible Solution
Not sure if the behavior could be caused by the maxReconciliationInterval being not set after the update or just informer caches being empty.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Non sono indicati file sorgente né test. Inizia riproducendo l’avvio dell’operatore con generationAwareEventProcessing abilitato e una risorsa personalizzata esistente il cui metadata.generation sia uguale a status.observedGeneration; traccia la riconciliazione all’avvio e la gestione della cache dell’informer. Il lavoro è completato quando le risorse invariate non vengono riconciliate all’avvio e un test di regressione copre questo caso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, kubernetes
- Ambito
- backend, infrastructure
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100