Reconciliation controls#
Three annotation-driven controls change how a specific, already-deployed
resource reconciles, without touching .genop.yaml or redeploying. For the
build-time equivalents — retry policy, success status, backoff, deletion
policy — see
Operator configuration.
Pausing reconciliation#
Set this annotation on a resource to suspend it entirely:
reconcile.<apiGroup>/pause=true<apiGroup> is the resource’s own API group — e.g.
reconcile.infrastructure.acme.io/pause=true for a VPC in the infrastructure
group.
While present with the value true, the operator skips every step, hook,
and finalizer check. The resource is set to Pending with the message
reconciliation paused, and re-checked every
pendingCheckInterval
(status is only re-written the first time, not on every re-check). Any
other value, or removing the annotation, resumes reconciliation from where
it left off.
Ignoring a step failure#
A single step’s failure can be suppressed without touching code:
<apiGroup>/<conditionType>=ignoreFor example, infrastructure.acme.io/VpcCreated=ignore on a resource whose
VPCProvisioned step (condition type VpcCreated) is stuck. The operator
logs a warning event, marks that step’s condition ErrorIgnored, and moves
on to the next step. This is a manual escape hatch for a genuinely
non-critical failure — use it deliberately, since it hides a real error
from kubectl wait/kubectl get until someone removes the annotation.
Forcing a step to re-run#
Steps run in order, and a step whose condition already reads True is
skipped — the right default for idempotent reconciliation, but not when a
later step’s action invalidates an earlier one. The worked example: an
operator has a ReconcileKubeVersion step and a ReconcileNetwork step;
upgrading Kubernetes can change the cloud provider’s network topology, so
ReconcileNetwork — already True — needs to run again before the
upgrade proceeds. RetryPolicyRestartAll is too blunt here: it wipes
every condition, not just the one that’s stale.
From code, when a step can detect the situation itself, call
DeleteCondition before returning — the next reconcile treats that
condition as unset and re-runs just that step:
func (s *ReconcileKubeVersion) Apply(ctx context.Context, logger logr.Logger, resource *MyResource) (ctrl.Result, string, error) {
if topologyChanged {
resource.GetStatus().DeleteCondition("NetworkReady")
return operators.Requeue(5*time.Second, "network topology changed, re-verifying before upgrading")
}
// ... proceed with the upgrade
}From an annotation, as a manual escape hatch for cases nobody wrote code for — the same key used to ignore a failure, with a different value:
<apiGroup>/<conditionType>=retryThe operator resets that one step’s condition and strips the annotation immediately, so it fires exactly once and can’t loop.
Either way, only the named step’s condition is reset — every other
already-True condition is left alone, and this is not treated as a drift
re-check. Forcing a non-last step to re-run also means the resource’s
Ready condition transiently reads False before the reconcile’s
fall-through sets it back to True in the same pass — a real, if brief,
transition a kubectl wait watcher could observe.