databricks bundle Deploy: exit code 0 even if an error occurs

a_user12
Contributor

We have a CI/CD pipeline where we run:

databricks bundle deploy [...]

The code works fine, however, if we missconfigure it, we see in the output an error message such as

Deploying resources...
Updating deployment state...
Warning: Detected unresolved variables after 1 resolution rounds

Error: terraform apply: exit status 1

Error: cannot update job: Cluster validation error: Validation failed for autoscale.max_workers, 

However, the exit code seems to be 0, the following commands are executed and the CI/CD step is marekd as green. 

It seems like a bug that bundle deploy doesn't deploy anything but the exit code is still 0.

Just to clarify: the error message is not the problem, the problem is that the exit code is 0 even if an error happens