Skip to main content

namespaced

Function namespaced 

Source
pub fn namespaced(client: Client, ns: &str) -> Api<Process>
Expand description

Bind a namespace-scoped typed Api<Process> handle for Client + ns.

Owns the 1-link chain Api::namespaced(<client>, <ns>) for the tatara Process CRD at ONE substrate owner across every workspace consumer that reads or writes a Process through a typed handle without a shared per-request context in scope. Sibling to the K8s-built-in ns-scoped handle binder crate::configmap::namespaced and to the reconciler’s per-request Context::process_api forwarder.

A future normalization of the Process-handle posture (a default-injected PatchParams field manager for status writes, a wired-in tracing span for handle construction, a per-namespace retry budget, a fixture-backed client for CI/smoke-tests) lands at THIS ONE function and every downstream consumer inherits the upgrade mechanically — no per-site edit at any of the three listed callers or at future consumers (a future boundary-layer evaluator for a new ConditionKind, a future below-controller binary that reads a Process by name, a future workspace-side audit walker).

The returned Api<Process> matches Api::namespaced verbatim — every current consumer chains through .get_opt(...) (both boundary-layer evaluators) or .get(...) (the export-worker snapshot reader) at its own callsite, so no wire-side posture is baked in at the primitive.

Theory anchor: THEORY.md §VI.1 (generation over composition — the 1-link Api::namespaced::<Process>(<client>, <ns>) chain recurred at 3 hand-authored sites past the ★★ PRIME-DIRECTIVE ≥ 2 duplication trigger and is lifted onto the ONE workspace- wide substrate owner here). THEORY.md §II.1 invariant 5 (composition preserves proofs — the pin block below binds the primitive at fail-before-pass-after granularity, so a regression that swapped the fixed K = Process type parameter for a different CRD (EphemeralPool, EphemeralAllocation, ProcessTable) or drifted the scope slot away from Api::namespaced — a stray Api::all cluster-wide read where a namespace-scoped dependency lookup was intended — surfaces at process_api::tests::* rather than as silent operator-facing skew across the three consumer sites).