-
Notifications
You must be signed in to change notification settings - Fork 12
🐛 Fix detection of a completed Deployment #239
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
Conversation
Per somewhat hidden documentation [1], we must inspect the Progressing condition and its Reason. Available is still True directly after an update because the old replica is still running. On top of that, stop reconciliation with a fatal error when the deployment no longer progresses. Unfortunately, client-go does not expose the necessary Reason constants, so I have to hardcode them based on the values from the documentation and real-world testing. [1] https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#complete-deployment Signed-off-by: Dmitry Tantsur <dtantsur@protonmail.com>
/hold Even this is not enough. |
Signed-off-by: Dmitry Tantsur <dtantsur@protonmail.com>
/hold cancel I think this approach works |
/cc @lentzi90 Your expertise is needed here. This patch is an outcome of trial-and-error. I don't think there are better options but I might very well be missing something. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks correct to me. It is quite ridiculous how hard it is to determine if a deployment is in good shape or not...
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lentzi90 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Per somewhat hidden documentation [1], we must inspect the Progressing
condition and its Reason. Available is still True directly after an update
because the old replica is still running.
On top of that, stop reconciliation with a fatal error when the
deployment no longer progresses.
Unfortunately, client-go does not expose the necessary Reason constants,
so I have to hardcode them based on the values from the documentation
and real-world testing.
[1] https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#complete-deployment
Signed-off-by: Dmitry Tantsur dtantsur@protonmail.com