MAQPNADocs

maqpna replace

Replace resources by file (kubectl replace)

Run agents-o json | yaml

Synopsis#

maqpna replace -f FILE|DIR|URL|- [-R] [-n NS] [--force] [--dry-run none|client|server]

Description#

replace updates each object to exactly the file's content (fields not in the file are dropped). --force deletes and re-creates the objects.

Flags#

FlagTypeDescriptionDefault
-R, --recursiveswitchrecurse into sub-directories of -f directoriesnone
--dry-runstringnone | client (nothing is sent) | server (the API server checks the change and stores nothing)none
-f, --filenamestringmanifest file, directory, URL or - (stdin); repeatablenone
--forceswitchdelete the objects and create them againnone
-n, --namespacestringnamespacedefault

The global flags (--context, -o, --no-color, ...) work with every command.

Examples#

maqpna replace -f toolpolicy.yaml
maqpna get tp coder-policy -n team-a -o yaml | sed 's/deny/allow/' | maqpna replace -f -

What happens when you run it#

  • --dry-run: none | client (nothing is sent) | server (the API server checks the change and stores nothing).
  • --force: delete the objects and create them again.
  • Prints a table by default; -o json or -o yaml print the data, and --jq EXPR filters the JSON.

Exit codes#

CodeMeaning
0success
1error (the message says what failed, with a hint when there is one)
2usage error: unknown flag, missing argument or bad value; the synopsis is printed
3a check failed, a change is blocked, or a result did not match (tamper, policy mismatch) (not used by this command)