timoni icon indicating copy to clipboard operation
timoni copied to clipboard

Dry-run status code when `--force` flag is not present

Open b4nst opened this issue 6 months ago • 2 comments

Currently a dry-run without a force will display something like that for immutable resources

2:20PM ERR i:object-name> Deployment/namesapce/my-app immutable (server dry run)

However it will exit with status 0. Imo this is wrong because if we remove the --dry-run and the object doesn't have the action.timoni.sh/force annotation, the apply will fail.

I propose we show an ERR and exit with an error status (maybe 2 to identify immutable error versus runtime error) if force arg is not used and action.timoni.sh/force is not set on that resource. If force or action.timoni.sh/force is present, then we can set a WARN or something like this and exit 0.

b4nst avatar Dec 27 '23 13:12 b4nst