maqpna delete
Delete resources by name, selector or file (kubectl delete)
Synopsis#
maqpna delete TYPE NAME... | TYPE/NAME... | -f FILE|DIR|URL [-n NS] [-l SELECTOR | --all] [--field-selector F]
[--cascade background|foreground|orphan] [--grace-period N] [--now] [--force] [--wait=true|false]
[--timeout D] [--ignore-not-found] [--dry-run none|client|server] [--yes]Description#
Deleting named objects works as in kubectl. Deleting by selector, --all or a category (maqpna) deletes many objects at once: it asks first on a terminal and needs --yes in scripts, like maqpna's other destructive commands. Deleting an AgentSession tears its sandbox down; maqpna session delete --terminate-now also revokes its token at the gateway at once. activerevocations are deleted through the gateway (maqpna revocations delete).
Flags#
| Flag | Type | Description | Default |
|---|---|---|---|
-A, --all-namespaces | switch | all namespaces | none |
-R, --recursive | switch | recurse into sub-directories of -f directories | none |
--all | switch | every object of the type (in the namespace, or with -A in all) | none |
--allow-gateway-mismatch | switch | send the context's login token to a gateway other than the one it was issued for (env MAQPNA_ALLOW_GATEWAY_MISMATCH=1) | none |
--cascade | string | background | foreground | orphan (dependents: sandboxes, pods) | background |
--dry-run | string | none | client (nothing is sent) | server (the API server checks the change and stores nothing) | none |
-f, --filename | string | manifest file, directory, URL or - (stdin); repeatable | none |
--field-selector | string | field selector evaluated on any field (spec.agentRef=coder,status.phase!=Failed) | none |
--force | switch | with --grace-period=0: remove at once, without waiting for the termination to be confirmed | none |
--gateway | string | gateway base URL (env MAQPNA_GATEWAY_URL; default: the context's gateway) | none |
--grace-period | int | seconds the objects get to terminate (-1: their default) | -1 |
--ignore-not-found | switch | a missing named object is not an error | none |
-l, --selector | string | label selector (e.g. app=coder,tier!=t0); Kubernetes kinds | none |
-n, --namespace | string | namespace | default |
--now | switch | same as --grace-period=1 | none |
--oidc-token-file | string | file holding an OIDC access token for the admin API (env MAQPNA_OIDC_TOKEN_FILE); wins over --token | none |
--timeout | duration | give up waiting after this long (0: no limit) | none |
--token | string | static admin token (env MAQPNA_ADMIN_TOKEN; dev/break-glass) | none |
--wait | switch | wait until the objects are gone | true |
-y, --yes | switch | do not ask for confirmation (required when stdin is not a terminal) | none |
The global flags (--context, -o, --no-color, ...) work with every command.
Examples#
maqpna delete sess coder-x1 -n team-a
maqpna delete -f agent.yaml
maqpna delete sess -l maqpna.com/agent=coder -n team-a --yesWhat happens when you run it#
- Talks to the gateway:
--gateway, elseMAQPNA_GATEWAY_URL, else the current context's gateway (maqpna context). - Authenticates to the admin API with the token stored by
maqpna login,--oidc-token-file, or a static--token(MAQPNA_ADMIN_TOKEN). --dry-run: none | client (nothing is sent) | server (the API server checks the change and stores nothing).--yes: do not ask for confirmation (required when stdin is not a terminal).--force: with--grace-period=0:remove at once, without waiting for the termination to be confirmed.--wait: wait until the objects are gone.- Prints a table by default;
-o jsonor-o yamlprint the data, and--jq EXPRfilters the JSON.
Exit codes#
| Code | Meaning |
|---|---|
0 | success |
1 | error (the message says what failed, with a hint when there is one) |
2 | usage error: unknown flag, missing argument or bad value; the synopsis is printed |
3 | a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command) |