-
Notifications
You must be signed in to change notification settings - Fork 21
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 Deployment Status Ready #65
Conversation
@@ -161,6 +165,7 @@ func (r *AuthorinoReconciler) Reconcile(ctx context.Context, req ctrl.Request) ( | |||
// SetupWithManager sets up the controller with the Manager. | |||
func (r *AuthorinoReconciler) SetupWithManager(mgr ctrl.Manager) error { | |||
return ctrl.NewControllerManagedBy(mgr). | |||
Owns(&k8sapps.Deployment{}). |
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.
if adding watcher to owned deployments, there is no need to requeue when the deployment is not ready.
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.
If we do not return in line
return ctrl.Result{Requeue: true}, nil |
return ctrl.Result{}, updateStatusConditions(logger, authorinoInstance, r.Client, statusReady()) |
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.
Then, instead of return ctrl.Result{Requeue: true}, nil
, it should be:
return ctrl.Result{}, updateStatusConditions(logger, authorinoInstance, r.Client, statusNotReady())
Anyway, leave it as it is. It is working as expected
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.
Added a new status condition DeploymentNotReady
(message: 'Authorino Deployment resource not ready'), @eguzki
6d0039a
to
f13cff7
Compare
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.
I do not think you need to requeue when deployments are not ready because the controller is watching for deployments updates.
But leave it as it is, it does not do any harm
Closes #63
Verification steps
Deploy this branch:
Create an Authorino instance whose Deployment will fail:
Check the status of the Authorino CR:
Fix the Deployment:
Check the status of the Authorino CR again: