You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update observedGeneration in reconcileStatus flow instead of reconcileSpec flow (#996)
* Update `ObservedGeneration` in reconcileStatus flow instead of reconcileSpec flow
* Compute `canReconcileSpec` only once; use `operatorContext` to pass reconciliation information to subsequent steps
* Address review comments from @unmarshall: simplify `operatorContext.Data` and `GetBoolValueOrDefault()` function
* Address review comments from @unmarshall: change `GetBoolValueOrDefault()` function to `GetBoolValueOrError()` to not swallow errors
* Address review comments from @unmarshall: add `r.completeReconcile()` which runs `updateObservedGeneration()` and `removeOPerationAnnotation()`
* revert minor change in code
// syncRetryInterval will be used by both sync and preSync stages for a component and should be used when there is a need to requeue for retrying after a specific interval.
// canReconcileSpec assesses whether the Etcd spec should undergo reconciliation.
127
+
// shouldReconcileSpec assesses whether the Etcd spec should undergo reconciliation.
166
128
//
167
129
// Reconciliation decision follows these rules:
168
130
// - Skipped if 'druid.gardener.cloud/suspend-etcd-spec-reconcile' annotation is present, signaling a pause in reconciliation.
169
131
// - Automatic reconciliation occurs if EnableEtcdSpecAutoReconcile is true.
170
132
// - If 'gardener.cloud/operation: reconcile' annotation exists and 'druid.gardener.cloud/suspend-etcd-spec-reconcile' annotation is not set, reconciliation proceeds upon Etcd spec changes.
171
133
// - Reconciliation is not initiated if EnableEtcdSpecAutoReconcile is false and none of the relevant annotations are present.
Copy file name to clipboardexpand all lines: internal/controller/etcd/reconciler.go
+35-19
Original file line number
Diff line number
Diff line change
@@ -85,28 +85,57 @@ type reconcileFn func(ctx component.OperatorContext, objectKey client.ObjectKey)
85
85
// Reconcile manages the reconciliation of the Etcd component to align it with its desired specifications.
86
86
//
87
87
// The reconciliation process involves the following steps:
88
-
// 1. Deletion Handling: If the Etcd component has a deletionTimestamp, initiate the deletion workflow. On error, requeue the request.
89
-
// 2. Spec Reconciliation : Determine whether the Etcd spec should be reconciled based on annotations and flags and if there is a need then reconcile spec.
90
-
// 3. Status Reconciliation: Always update the status of the Etcd component to reflect its current state.
91
-
// 4. Scheduled Requeue: Requeue the reconciliation request after a defined period (EtcdStatusSyncPeriod) to maintain sync.
88
+
// 1. Deletion Handling: If the Etcd component has a deletionTimestamp, initiate the deletion workflow.
89
+
// On error, requeue the request.
90
+
// 2. Spec Reconciliation : Determine whether the Etcd spec should be reconciled based on annotations and flags,
91
+
// and if there is a need then reconcile spec.
92
+
// 3. Status Reconciliation: Always update the status of the Etcd component to reflect its current state,
93
+
// as well as status fields derived from spec reconciliation.
94
+
// 4. Remove operation-reconcile annotation if it was set and if spec reconciliation had succeeded.
95
+
// 5. Scheduled Requeue: Requeue the reconciliation request after a defined period (EtcdStatusSyncPeriod) to maintain sync.
0 commit comments