crossplane-runtime icon indicating copy to clipboard operation
crossplane-runtime copied to clipboard

Status is not updated if `ResourceExists: false`

Open muvaf opened this issue 3 years ago • 2 comments

What problem are you facing?

It's related to https://github.com/crossplane/crossplane-runtime/issues/285 but actually different than what that issue talks about which is status updates happening in Create call.

This issue is specifically about the case where status is lost if Observe returns ResourceExists: false due to missing resource. In most cases, this is OK because if external.Create fails, we do update the status and in the next reconcile when ResourceExists: false is returned, there isn't much information in status that we'd like to be updated anyway.

However, in cases where external.Create only acts as a trigger for creation and errors of that creation are surfaced only in the next reconciliations, mostly in resources whose creation takes long like Kubernetes clusters or DB instances, we get a hold of the error of creation in Observe and at the same time we need to return ResourceExists: false to re-trigger the creation in case the problem is fixed. But the error at that point is not in the form of err error, but more of an information on the response object returned from a successful GET call. That error is written to status as status of the resource, however, since the status is dropped due to returned ResourceExists: false, we lose that information.

How could Crossplane help solve your problem?

We can issue a Status().Update() before starting our new process of creation here.

muvaf avatar Dec 04 '21 14:12 muvaf

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 07:08 stale[bot]

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] avatar Sep 03 '24 09:09 github-actions[bot]