Skip to main content

Module cleanup

Module cleanup 

Source
Expand description

Finalizer steps. Finalizer for a KanidmRadiusServer.

Order:

  1. Delete our Deployment in the foreground.
  2. Wait until no ReplicaSet or pod uses our config Secrets or tokens.
  3. Remove our idm_radius_servers membership edge and delete the account (which removes every token on it).
  4. Remove the finalizer; owner-reference GC removes the config Secrets and the Service.

Skips: when the referenced Kanidm CR no longer exists, or the account exists without our ownership marker, the Kanidm cleanup is skipped with a Warning event and the finalizer is removed: deletion never blocks forever on something the CR does not own or cannot reach by design. A Kanidm CR that exists but is unreachable is a transient error and retries with backoff.

next_step and identity_cleanup are pure; the reconciler performs one step per pass and requeues while waiting.

Structs§

CleanupView
What the finalizer sees in one pass.
DrainWarnings
The consumer set each deleting CR (by UID) was last warned about, and when. Kept in memory: the finalizer requeues every few seconds and an event per pass would flood the namespace, while an operator restart only repeats one warning.

Enums§

CleanupStep
The next thing the finalizer does.
DeploymentPhase
Finish
How the finalizer ends after the identity step.
SkipReason
Why the Kanidm cleanup was skipped.

Constants§

DRAIN_WARNING_INTERVAL
An unchanged set of consumers is warned about at most this often.
DRAIN_WARNING_REASON
Event reason while deletion waits for consumers to stop.

Functions§

drain_note
Event note naming the consumers deletion waits for. Bounded: at most [DRAIN_NOTE_MAX_CONSUMERS] names, the rest counted.
identity_cleanup
Map the result of delete_identity to how the finalizer ends. Transient errors keep their source and retry with backoff.
next_step
Decide the next finalizer step. Pure.