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

resource: use Patch in APIFinalizer #550

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sttts
Copy link
Contributor

@sttts sttts commented Sep 18, 2023

Description of your changes

Calling Update on a non-unstructured object will potentially lead to data-loss because it is not guaranteed that the object is a complete representation of all the fields stored in the apiserver, e.g. because of version skew between client and Crossplane.

I have:

  • is that type cast safe?
  • do we have enough test coverage to confirm the safety of this change?
  • maybe run proof PR in crossplane
  • 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

Via Crossplane test suite, aka unit tests and e2e tests.

@sttts sttts requested review from a team as code owners September 18, 2023 19:30
Signed-off-by: Dr. Stefan Schimanski <stefan.schimanski@upbound.io>
@sttts
Copy link
Contributor Author

sttts commented Sep 18, 2023

Actually, this can lose changes that were made before calling the finalizer code, i.e. there is no way around comparing to a fresh object :-/

@sttts sttts marked this pull request as draft September 18, 2023 20:47
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.

None yet

1 participant