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

resource: use Patch in APIFinalizer

Open sttts opened this issue 2 years ago • 3 comments

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
  • [x] Read and followed Crossplane's contribution process.
  • [x] 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 avatar Sep 18 '23 19:09 sttts

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 avatar Sep 18 '23 20:09 sttts

Crossplane does not currently have enough maintainers to address every issue and pull request. This pull request 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. Adding a comment starting with /fresh will mark this PR as not stale.

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