Skip to main content

sng destroy

Available

Deployed and supported. The fields and commands described here are stable within version v1alpha1.

sng destroy FILE.yml [-y]

Reads FILE.yml (one or several YAML documents) and deletes each resource it describes, identified by its kind and metadata.name, in the current tenant. The file is never modified: this is the counterpart of sng apply, which never deletes anything. It requires a tenant session (sng tenant use).

ArgumentDescription
FILE.ymlmanifest file (one or several documents)
FlagEffect
-y, --yesno interactive confirmation; required outside a terminal (script, CI)

Before deleting anything, the command lists the targeted resources and asks for confirmation.

sng destroy web.yml
sng destroy stack.yml --yes
⚠ Suppression définitive de :
- App/web
- RegistryRepository/web
Tapez « oui » pour confirmer : oui
deleted: App/web
deleted: RegistryRepository/web

Resources are deleted in the order of the file, with the same deletion policy as sng kind delete (the volumes of an App are kept, a RegistryRepository in Block refuses while it holds images…). If a deletion fails, the command stops on that resource and prints Kind/name: <error>; the previous ones stay deleted.

--json: {"deleted": [{"kind": "App", "name": "web"}, …]}.

Typical errors​

MessageCause
FILE.yml: no manifest foundthe file contains no manifest
confirmation requise : relancez avec --yes ou depuis un terminal interactifrun outside a terminal without --yes
opération annuléean answer other than « oui » to the confirmation
forbidden (no policy of this tenant allows it: see sng tenant policy list)deploy:delete is missing on one of the resources

See also​