maqpna auth can-i
Ask the API server whether you may do something (SelfSubjectAccessReview)
Synopsis#
maqpna auth can-i VERB TYPE[/NAME] [-n NS | -A] [--subresource S] [-q]
maqpna auth can-i --list [-n NS]Description#
From the help of maqpna auth:
can-i asks the API server whether you may VERB the type (MAQPNA names and short names work: maqpna auth can-i create sess; any other resource is passed through: maqpna auth can-i create pods/exec). It prints yes or no and exits 0 or 1. The gateway's runtime kinds are authorized by the gateway's admin roles, which auth whoami lists.
Flags#
| Flag | Type | Description | Default |
|---|---|---|---|
-A, --all-namespaces | switch | all namespaces | none |
--list | switch | list what you may do in the namespace (MAQPNA kinds first) | none |
-n, --namespace | string | namespace | default |
-q, --quiet | switch | print nothing; the exit code is the answer | none |
--subresource | string | a subresource (exec, log, status, ...) | none |
The global flags (--context, -o, --no-color, ...) work with every command.
Examples#
maqpna auth can-i create sess -n team-a
maqpna auth can-i create pods --subresource exec -n team-aWhat happens when you run it#
- 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) |