-
Notifications
You must be signed in to change notification settings - Fork 907
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
Tag deleted from claim spec is added back #3421
Comments
If you stop crossplane and remove and start again it should working - did you tried ? |
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as |
/fresh looks still relevant |
I did run some experiments to see whether server side apply can help here, my findings so far:
Overall, the server-side seems promising, and we can at least change the claim controllers applicator from patching to server-side apply. Switching to server-side apply for applying composed resources is definitely a broader topic. We need to spend more time on that and ensure we do enough testing. One idea could be switching only to NewPTFComposer, which is used when the composition functions are enabled. |
This is in line with the behavior I'm observing in a composition of our own to manage AWS RDS Aurora DBClusters. Different from this case, it's not a tag that is never removed, but a simple field. What is also different, is that we're able to remove it from the claim with no problem, but it never gets removed from the composite, as you've described with server-side apply:
Unfortunately, our composition and XRD are quite large, using some CRDs of our own as well, so I doubt it will be of much help in investigating due to all the noise. I was not able to create a small reproducer, all my attempts lead to the behavior described in this issue: I'm unable to remove it from the claim itself. |
Signed-off-by: Hasan Turken <turkenh@gmail.com>
Fixed via #4896. |
What happened?
We have observed an issue with @stevendborrelli where a tag is deleted from a map in a claim spec parameter, and it gets added back to the claim. Please see below for an example XRD, claim and composition.
After you remove the tag key from the claim’s
spec.parameters.tags
map (and expect first the XR’s corresponding map to be updated, and then the MR’sspec.forProvider.tags
map to be replaced because of the composition’s relevant patch), the removed key gets reinserted by theclaim.APIClaimConfigurator
, which configures a claim using the associated XR. At this point, the tag key is missing (fromspec.parameters.tags
) in the claim but it still exists in the XR. TheAPIClaimConfigurator
merges the spec of the XR into the claim’s spec usingmergo.Merge
. Andmergo.Merge
puts the missing key in the claim’sspec.parameters.tags
from the XR’s map (which still contains it) while merging these maps.There is no race condition involved. The claim reconciler uses a
resource.APIPatchingApplicator
to patch the XR via a JSON-merge patch but this can not remove the key (map not replaced, there is now a missing key in a map, which has no effect). However,resource.APIPatchingApplicator
fetches the current spec of the XR and puts it into the same object that will later be used to configure the claim (via theAPIClaimConfigurator
as explained above).Thus the claim acquires back the deleted key.
How can we reproduce it?
Using the following XRD, claim and composition, please delete the
test
key from claim's (AWSGlueTrigger
)spec.parameters.tags
:What environment did it happen in?
Crossplane version:
v1.10.0
The text was updated successfully, but these errors were encountered: