Skip to main content

Module create

Module create 

Source
Expand description

Substrate primitive for the create-verb wire idiom over any kube Resource.

Owns the 2-link chain

api.create(&PostParams::default(), &obj).await

that every controller-side writer hand-authored pre-lift at each spawn / bind / seed / receipt-write site.

Sibling to the patch-family substrate primitives in crate::patch on the wire-verb axis: crate::patch::merge owns the primary- resource merge-patch posture, crate::patch::merge_status owns the /status-subresource merge-patch posture, crate::patch::apply_patch_params owns the server-side-apply PatchParams composition; this primitive completes the family with the create (POST) verb — the third wire-verb axis every workspace controller stamps at its idempotent-write sites.

Pre-lift the 2-link api.create(&PostParams::default(), &obj) chain recurred at FIVE hand-authored consumer sites across FOUR crates:

  • tatara-pool-reconciler::controller_pool::spawn_members — the spawn-branch new-member Process create.
  • tatara-pool-reconciler::controller_pool::apply_convergence_action (ConvergenceAction::CreateMember arm) — the desired-loop spawn peer of the site above.
  • tatara-reconciler::patch::ensure_process_table — the cluster- scoped ProcessTable singleton seeder.
  • tatara-github-watcher::handler::handle_pr_event — the PR-event allocation-create site.
  • tatara-closed-loop-probe::main::write_receipt_configmap — the receipt ConfigMap create-then-409-retry seed (its 409 retry-arm already routes through crate::patch::merge and crate::kube_error::is_conflict, leaving the create-verb the last unlifted link in that chain).

Four of the five sites additionally pair the create call with the is_conflict guard already lifted in crate::kube_error — the compound “create-or-treat-409-as-ok” idiom the workspace stamps at every optimistically-created resource. Post-lift both halves of the compound (create::default + kube_error::is_conflict) ride through ONE substrate owner apiece so the compound reads exactly create::default(&api, &obj) → is_conflict at each callsite.

§Naming

The primitive is named default — the PostParams::default() slot is the axis it closes, mirroring the naming discipline the rest of the wire-verb family follows (merge names the Merge posture, merge_status names the /status subresource, and apply_patch_params names the apply(...) posture). A caller reads create::default(&api, &obj) and understands they are dispatching through the default PostParams posture — no dry_run, no field_manager bound (create writes are not SSA and do not participate in the field-manager ownership model).

Functions§

default
Create a kube Resource through its namespaced or cluster-scoped Api with the default PostParams posture.