resource: use Patch in APIFinalizer
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 testto ensure this PR is ready for review.
How has this code been tested
Via Crossplane test suite, aka unit tests and e2e tests.
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 :-/
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.