Enable deleting objects when identity of manifest changes #349
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of your changes
This is an attempt to move the discussion of #287 forward.
I think some of the issue is that the interfaces provided by
crossplane-runtime
(e.g themanaged.ExternalObservation
) doesn't allow to neatly encode theObserve
function wanting to return a the operations required for a rename (e.g a Delete + Create). Without changing interfaces etc, which may be a heavy ask for the needs of potentially a single provider, we might have to be a little creative.At first, I tried dealing with the Deletion of the previous resource in
Create
, but its problematic becauseObserve
will try to updateatProvider
, which overwrites the information we need to delete a previously managed object.Doing the deletion in
Observe
is a less noisy option code-wise, but of course means that "Observing" might entail "Delete something", and I'd love to hear opinions on this with possible solutions (e.g like updating the interface/structs from the runtime, expanding the Object resource to include resource references etc -- these are larger lifts, but it would be great to have clarity whether doing the requisite work for that would end up with the work being merged before committing to it).Fixes #287
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Running locally in a local dev environment.