sng destroy
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).
| Argument | Description |
|---|---|
FILE.yml | manifest file (one or several documents) |
| Flag | Effect |
|---|---|
-y, --yes | no 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
| Message | Cause |
|---|---|
FILE.yml: no manifest found | the file contains no manifest |
confirmation requise : relancez avec --yes ou depuis un terminal interactif | run outside a terminal without --yes |
opération annulée | an 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
sng kind delete: delete a single resource by kind and namesng apply: apply the same file