Expand description
Ownership-checked server-side apply, create-only Secret and delete. Ownership-checked Kubernetes writes for the RADIUS controller.
Every generated object is checked with ensure_not_foreign before the
controller touches it, so a same-named Deployment or Service created by
someone else is reported as a conflict and never adopted, even when its
labels match. Generated objects are written with server-side apply under
FIELD_MANAGER with force, so a conflict with another field manager
(for example kubectl scale) cannot wedge the reconcile with a 409. Config
Secrets are create-only and immutable; deletes carry UID and
resourceVersion preconditions so a recreated object is never removed.
Server-side apply cannot be made conditional on non-existence, so a foreign object created between the read and the patch would be merged into. The patch response is therefore checked again and a foreign result is reported as a conflict; the window is a single API round trip.
Enums§
- Delete
Mode - How an object is deleted.
- Delete
Outcome - What
delete_owneddid. - Secret
Outcome - What
ensure_config_secretdid.
Constants§
- FIELD_
MANAGER - Server-side apply field manager.
Functions§
- apply_
owned - Server-side apply
desiredunless a foreign object holds the name. - apply_
params - Parameters for every server-side apply: our field manager, with
force. - check_
not_ foreign - Read the object if present and fail on a foreign one, without writing. Use it to refuse early (for example before minting a token).
- delete_
owned - Delete an object we control. Absent is success; a foreign object is an
error and is never touched; failed preconditions are
ExecError::ConcurrentMutation(re-observe and retry). - delete_
params - Bind a delete to the exact object that was checked: a name can be deleted and recreated between GET and DELETE, and without both preconditions the replacement would be removed.
- ensure_
config_ secret - Create the immutable config Secret if absent. Never patches or overwrites: an existing Secret (found by GET, or by a 409 from a racing reconcile) must be ours and identical, otherwise it is a conflict.
- ensure_
not_ foreign - Reject an existing object that is not controlled by
owner. - is_
controlled_ by - Is
metacontrolled byowner? The controller reference (at most one per object) must name the owner’s UID and kind. Extra non-controller references are allowed; a missing, different or non-controller reference is not ours. - verify_
existing_ secret - The existing Secret must be ours and byte-for-byte what we would create: same type, immutability, data, token id and rotation request. The name is content-addressed, so a difference means a conflicting writer, not a stale read.