-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wait until the database is reachable in job-create-site #207
Conversation
I also added the ability to attach |
I have just finished testing the pull request by deploying it multiple/many times. The issue seems to be properly fixed now. At least it is not reproduceable in this branch anymore. |
I fixed a few minor issues and did some enhancements. |
Wait for the database in the init container to become reachable before trying to create a new site. Without waiting there is a race condition that pops up occasionally which makes the creation of the site fail.
Exit the main container of the job if any error happens by adding
set -e
. At the moment the container exists with the return code 0, even if the site was not successfully created. This is because the last command in the entrypoint is anrm -f
which always exits with 0.helm/erpnext/templates/job-create-site.yaml
Line 104 in 275c25f
Related to #205
Actually exiting the container with the correct exit code is enough to fix the issue if the job is configured to restart if failed. Though, waiting for the database in the beginning is cleaner.