feat: domain.Request/Result, requeue:, failPolicy:, ToClient cache - #265
Merged
Conversation
…licy:, ToClient cache Breaking renames: - anyOf: → or: across the entire schema (gates, autoscale, serve, status, validation) - hooks.resources: / constructor.resources: → managedResources: - domain.Reconciler: Reconcile(ctx, key string) error → Reconcile(ctx, Request) (Result, error) New: - requeue: per-object scheduled requeue after successful reconcile (when:/or: conditions, template after:) - failPolicy: open/closed on enqueueGate and reconcileGate - ToClient cache-backed Get/List from informer store; falls through to live API on miss - domain.ReconcilerFrom forwards ctrl.Result.RequeueAfter through the bridge - ork migrate generator updated: managedResources:, corrected toclient README template - reconciler-model docs rewritten: two models, kordinator page, resync vs requeue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR follows #264 (controller-runtime compat) and completes the picture.
The signature change that unlocks everything
domain.Reconcilerused to be:It is now:
Result.RequeueAfternow flows from every reconciler — typed or declarative — into the workqueue. A cert-rotation operator written entirely in YAML can say:and each CR schedules its own next reconcile from its own state. The same path that carries
ctrl.Result.RequeueAfterfrom a migrated controller-runtime reconciler now carries YAML-declared requeue intent from a declarative operator. One mechanism, two surfaces.controller-runtime gets cache reads
kubeclient.ToClient(kube)now servesclient.Getandclient.Listfrom the informer store for any type with a registered informer — the primary CRD and everywatch:entry. Types without an informer fall through to a live API call. This restores the caching behaviour thatmgr.GetClient()provided before migration, silently and without any change to the reconciler.New features
requeue:— per-object, per-state requeue onreconciler.requeue:. Conditional viawhen:/or:.after:is a template expression with the full post-reconcile resolver.failPolicy:—open(default) orclosedon bothenqueueGateandreconcileGate. Controls what the gate does when anexternal:call fails. Validator warns whenexternal:is declared without an explicit policy.Breaking renames
anyOf:→or:everywhere in the schema. Reads naturally alongsidewhen:.hooks.resources:/constructor.resources:→managedResources:— removes the ambiguity with thewatch:block.domain.Reconcilerinterface — all implementors updated.Documentation updated.