Hey! We need a way to distinguish between differen...
# general
Hey! We need a way to distinguish between different
pulumi up
failures (conflict, pending resources etc.). Other than running grep on output is there any other way? f.e. different exit codes to different errors?
Currently we don’t have differentiated exit codes. Can you give more details on the errors you are trying to distinguish between? Would love to understand whether they are something we could ever imagine differentiating based on exit code - or whether they will better be solved by including error information in
output or similar.
That’s super useful! We’d like to have this for potential automatic recovery during deployments and/or taking other action (notifying) depending on the error
For example we would like to have a self healing automation in our deployment flow in case we failed with a 'pending resources' failure (fix stack and continue with deployment). In general i think it's a good practice (and a well adopted one) to have different exit codes to different errors in any CLI tool
Another example, in case of a conflict error (update already in progress) we might want to add a sleep to the process rather than fail the whole deployment. Regarding your suggestion, adding error information to json output is not that different than grep on stdout\stderr and might be more suitable to API calls but not to the pulumi CLI tool.
Great. Those two examples are definitely things we could distinguish as unique exit codes. Would you mind opening an issue to suggest this? (I actually thought there was one already - we’ve definitely talked about this before - but couldn’t find it in a quick search).
Thanks @white-balloon-205 for your help! Opened an issue for this purpose: https://github.com/pulumi/pulumi/issues/3897
👍 1