Skip to main content

Module env

Module env 

Source
Expand description

gtc op env {create,update,list,show,doctor,destroy} (A3 of plans/next-gen-deployment.md).

Commands operate directly on the EnvironmentStore from A2. Each mutating call validates the payload before touching disk.

Structs§

EnvCreatePayload
Payload accepted by op env create (and op env update).
EnvInitPayload
Payload accepted by op env init. Init is otherwise a fixed-shape bootstrap of the canonical local env; the only optional input is the public URL persisted on the env’s host_config.
EnvSummary
Returned by op env create / op env update.

Functions§

apply_revision
op env apply-revision <env_id> <revision_id> [--kind <descriptor>] — bring a SINGLE revision’s worker resources into agreement with its recorded lifecycle. A revision with cluster presence (Warming / Ready / Draining) has its worker Deployment + Service applied; an absent one (Staged / Failed / Archived / Inactive) has them torn down. The surgical counterpart of reconcile, which converges the WHOLE env — apply-revision assumes the env-level set (namespace, router) already exists (establish it with reconcile), so it only touches the one revision’s worker pair.
apply_traffic
op env apply-traffic <env_id> <deployment_id> [--kind <descriptor>].
create
op env create. Idempotent: if the env already exists, fails with OpError::Conflict — callers wanting upsert semantics should use update.
destroy
op env destroy <env_id> --confirm. Removes the env’s on-disk state.
doctor
op env doctor <env_id>. Re-validates the env against Environment::validate and checks for missing capability slots. Returns a structured report instead of failing on the first issue.
env_create_payload_schema
Hand-written JSON Schema stub for EnvCreatePayload. Replaces the full schemars derive until A1’s deferred schemars wiring lands; the operator surface still gets a useful machine-readable description of the payload.
init
op env init. Idempotent bootstrap of the local env with its five default env-pack bindings; on first init only also seeds the operator key into the env trust root so signature-gated verbs (revenue-policy, bundle/revision DSSE) work out of the box (N1.4). The gate sits on <env_dir>/trust-root.json’s presence, so a routine init cannot re-grant a key revoked via trust-root remove.
list
op env list.
reconcile
op env reconcile <env_id> [--kind <descriptor>] — apply the env’s declarative desired state to its live cluster and prune the workers of revisions no longer present. The apply-side counterpart of render (use render for a no-side-effect preview, or a GitOps repository handoff).
render
op env render <env_id> [--kind <descriptor>] [--output <dir>] (plan §6 step 10). Renders the env’s declarative desired state through the deployer env-pack’s ManifestRenderer without applying anything — the artifact for direct-apply preview, GitOps repository handoff, or rendered-manifest handoff.
set_public_url
op env set-public-url <env_id> <URL>. Dedicated verb that ONLY mutates host_config.public_base_url; safer to expose than op config set (which can update name/region/tenant-org/listen-addr in the same call) when callers just want to point the env at a different origin.
show
op env show <env_id>.
tool_check
op env tool-check <env_id>. Runs each binding’s crate::env_packs::EnvPackHandler::preflight and aggregates the per-binding crate::tool_check::ToolCheck results into a structured outcome.
update
op env update. Replaces name, region, and tenant_org_id on an existing env. The packs/bundles/revisions/traffic_splits arrays stay untouched — manage those via their own subcommands.