-
Notifications
You must be signed in to change notification settings - Fork 106
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
Consistent readiness status updates #583
Comments
This makes sense to me. Reflecting on the Updates feels less of an issue compared to |
Would this also mean that a failed update results in the resource no longer being ready? I think that would be really valuable; the fact that this doesn't happen (at least not always) today makes troubleshooting much harder. |
Yes, it would work like that. When the update, err := external.Update(externalCtx, managed)
if err != nil {
log.Debug("Cannot update external resource")
record.Event(managed, event.Warning(reasonCannotUpdate, err))
managed.SetConditions(xpv1.Updating(), xpv1.ReconcileError(errors.Wrap(err, errReconcileUpdate)))
return reconcile.Result{Requeue: true}, errors.Wrap(r.client.Status().Update(ctx, managed), errUpdateManagedStatus)
} I was thinking of opening a PR for this, but haven't had the time yet. It would require some testing too, but I am not that up to date on the code here. |
Does a resource being updated mean it's not ready? I don't think so, at least not usually. The When the provider requests that a resource be created, it typically takes a little time for the creation process to complete. During this time the resource isn't usable. The provider confirms the creation has succeeded before marking the resource ready. When the provider requests that a resource be updated, it doesn't necessarily prevent anyone from using the external resource. Some resources (for example a GKE cluster) may enter a state like 'Repairing' and be degraded or unavailable while the external system processes the update. This isn't always the case though - in fact anecdotally I think it's less common. |
I totally agree with this, we currently use the ready status on a resource to determine whether or not we can access From our perspective, a resource that is updating is still "ready" even if the update fails because its existing status properties remain valid. For example we may request to expand a disk on a VM which fails, but other resources consuming that VM's ID should consider the VM ready.
|
More robust status conditions like it sounds like are being discussed here would be a better solution to crossplane/upjet#327 than what I proposed in that issue. |
Also related: #198 If we basically merge synced/upToDate into Ready as Reason, I think we should try to get reason as a field in additionalPrinterColumns so the same information in |
And this? :) #39 |
And: #363 (comment) |
What problem are you facing?
The
Ready
status of a resource is reflected nicely when the resource is being created, but not so when updating or doing other things.For example, when a resource needs to be updated, there is no status indicating this to the user, except for an event and log saying "Successfully requested update of external resource". The
Ready
status will just betrue
while this is happening. Successfully updating a resource also doesn't returnreconcile.Result{Requeue: true}...
, which means it won't trigger an observe right after to confirm that the update did its job.When creating a resource, the
Ready
status is set tofalse
withCreating
as the reason both when it errors and succeeds, which is the correct way to do it. It also returnsreconcile.Result{Requeu: true}...
to make sure the resource is ready for use.How could Crossplane help solve your problem?
I don't see why Create should be different than Update, so I would prefer if they were consistent.
I would personally add a
ConditionReason
for this as well as a helper function to set theReady
status for you, like its done with Create and Delete:The code that executes
external.Update
should be updated to return thisreconcile.Result
:return reconcile.Result{Requeue: true}, errors.Wrap(r.client.Status().Update(ctx, managed), errUpdateManagedStatus)
All the returns related to the update should also add
xpv1.Updating()
to itsSetCondition
:managed.SetConditions(xpv1.Updating(), xpv1.ReconcileSuccess())
The text was updated successfully, but these errors were encountered: