Skip to content
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

Set Creating and Deleting conditions close to Status().Update() calls #292

Merged
merged 2 commits into from
Sep 17, 2021

Conversation

negz
Copy link
Member

@negz negz commented Sep 15, 2021

Description of your changes

Relates to #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.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

I haven't yet.

I don't believe these are used anywhere anymore.

Signed-off-by: Nic Cope <negz@rk0n.org>
Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a few additions. The rest looks good to me but I think this fixes only one part of #285 . We still lose the status set in external.Create so we shouldn't close that issue.

pkg/reconciler/managed/reconciler.go Show resolved Hide resolved
@negz
Copy link
Member Author

negz commented Sep 17, 2021

We still lose the status set in external.Create so we shouldn't close that issue.

Oh - I missed that. I didn't think we actually had any managed resources that modified status during Create (apart from setting the Creating status condition, which we now handle in the reconciler). Do you have an example of resources that do this? Now that I think about it I'm vaguely remembering some of the Azure resources recording operations there?

@muvaf
Copy link
Member

muvaf commented Sep 17, 2021

I had not thought about Azure but yes and in fact, it could be showstopper since the creation process is being tracked with that ID. I was thinking about AWS, where the response of Create operation is stored in status, which in some cases is different than Describe, though I couldn't find an example now.

FWIW, there is this KEP by Tim Hockin that removes the litmus test of If I erased the whole status struct, would everything in it be reconstructed (or at least be reconstructible) from observation? So, status won't be treated as ephemeral as it used to be.

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>
@negz negz merged commit 9f3f799 into crossplane:master Sep 17, 2021
@negz negz deleted the creation branch September 17, 2021 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants