-
Notifications
You must be signed in to change notification settings - Fork 101
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
Status updates in ExternalClient.Create
are omitted
#285
Comments
@negz this issue causes |
crossplane#285 This approach causes us to repeat ourselves a bit, but prevents issues like the above, where refactoring caused us to accidentally overwrite a pending status update that we hadn't committed. Signed-off-by: Nic Cope <negz@rk0n.org>
Whoops - good catch. I always look at events now so I didn't even notice. I think there's a simpler fix for status conditions specifically per #292. That won't cover the case in which a |
crossplane#285 This approach causes us to repeat ourselves a bit, but prevents issues like the above, where refactoring caused us to accidentally overwrite a pending status update that we hadn't committed. Signed-off-by: Nic Cope <negz@rk0n.org>
We noted in #292 (comment) that this pattern does in fact exist, at least in some AWS and Azure controllers. |
Hasan had a similar suggestion during review of a PR that lead to #283. |
Despite the guidance around the status field's "recreatability" being relaxed per kubernetes/enhancements#2537 I think we should be warning folks to update status (or really any part of the managed resource) during the That said, if we know there are edge cases where we have no alternative but to rely on persisting updates made during I don't love the idea of having to extract and save status so we can later persist it again, especially if it requires modifying the
I think the alternative I like the best is still just trying to establish a "thou shalt not update anything (except annotations) during Create" rule. If I understand correctly we haven't yet found any AWS resources that make status updates in |
FYI, this causes reconciler to drop any status update made in
That rule wouldn't apply in this case unfortunately, where creation error needs to be saved and |
I'm working through this today, trying to determine how much of a blocker it could be for updating providers to the latest version of crossplane-runtime. First let me make sure I understand the situation. You're pointing out that in some cases a As far as I can tell, we still will update the status in most cases. For example:
Is my understanding here correct, or am I missing something? Also, can you let me know whether Terrajet providers are still affected by this? I notice that crossplane/terrajet#103 removed the block you referenced where we were previously recording a status condition during |
The case I'm referring to is where we have to return
That was a workaround and now we're doing a similar thing in callback mechanism by issuing a status update right after the operation completes, but that doesn't apply to native async resources since they don't have such callback mechanism from the APIs they consume. But for Terrajet, we should be good. |
Is this hypothetical, or do we do this in practice? As far as I could tell none of the examples you provided follow this pattern. |
@negz We do that in Terrajet in this line to trigger a new creation, here in Azure PostgreSQL. In fact, I think it can be considered a bug if we don't do that because then it'd mean we just never retry once a long-running creation fails. We don't see that very often since cloud providers like AWS and GCP make their best to do all validations in the creation calls, albeit there are always cases in those, too, where validation passes but creation fails due to external factors like insufficient capacity. |
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. |
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
What problem are you facing?
With #283, we issue a standard update in all cases and that causes the
status
to be lost since managed resources treat it as subresource. But there are cases where some information about the resource is available only in the response of the creation call to the API.How could Crossplane help solve your problem?
We could possibly expand
resource.Managed
interface to haveGetStatus() runtime.Object
andSetStatus(runtime.Object)
and thenDeepCopy
the status before the update operation and later callSetStatus
on the returned object and issue a status update this time.The text was updated successfully, but these errors were encountered: