sng env
Deployed and supported. The fields and commands described here are stable within version v1alpha1.
sng env chooses the revision of the desired state that your tenant follows. By default
a tenant follows main: each apply is deployed immediately. The commands in this group let
you pin, catch up, restore, and clone. The concept is explained in
Environments and restore.
All of them require a tenant session. IAM actions: env:read (list), env:write
(checkout, refresh), env:admin (restore, create-tenant).
sng env list
sng env list
Shows the environment configuration of the current tenant.
branch main
follow-main false
--json: {"tenant":"acme","branch":"main","follow_main":false,"raw":"…"}.
| Key | Meaning |
|---|---|
branch | main, or the name of the version the tenant is pinned to |
follow-main | true if the pinned branch advances automatically when main advances |
sng env checkout
sng env checkout NAME [--follow]
Pins the tenant to the NAME branch, created from the current state if it does
not exist. checkout main goes back to normal tracking.
| Flag | Default | Effect |
|---|---|---|
--follow | disabled | The branch advances by fast-forward every time main advances without diverging |
NAME is a simple path segment (letters, digits, hyphens). The command responds
202 Accepted: the switch takes effect in less than a minute.
sng env refresh
sng env refresh
Enables follow-main on the current environment and triggers an immediate advance. Error
400 already on main if the tenant is not pinned.
sng env restore
sng env restore REF
Replaces the tenant's desired state with the content of REF (main, env/<tenant>/<nom>,
or a specific revision from the history), then applies it. Manifests absent from REF are
deleted. Secrets are not affected.
Action env:admin. No interactive confirmation: run a sng pull first.
sng env create-tenant
sng env create-tenant NAME [REF]
Creates the tenant NAME and copies into it the desired state of the current tenant at
revision REF (default: the tracked revision). NAME follows the
naming rules and must be available. The new
tenant receives its default policies; you are its administrator. Secrets are not copied.
Responds 202 Accepted; as after sng tenant create, the first sessions may respond
policies_pending for one or two minutes.
Typical errors
| Message | Cause |
|---|---|
forbidden (no policy of this tenant allows it: see sng tenant policy list) | env:write or env:admin is missing |
already on main | refresh on a tenant that is not pinned |
invalid organization: … | Invalid or reserved tenant name (create-tenant) |
conflict | The tenant name is already taken |