-
Hi! We're having trouble writing "reproducible" Compositions. Repro steps: Write a patch like this:
The next day, I decide that label name was wrong, so i modify the composition to do this:
Expected behavior: Crossplane would re-apply the Composition and do a 3-way merge on the managed resource. The new resource would only have Actual behavior: Crossplane leaves the old state around, so that my resource has both Additional info: This behavior seems very dangerous to me. It means Compositions can leak state from previous versions of the Composition. We can't guarantee that the desired state of the Composition reflects the current status of the resource. Is there a way to get it to do a 3-way merge, like Helm or |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@nicks Try switching to composition functions, and using https://marketplace.upbound.io/functions/crossplane-contrib/function-patch-and-transform/v0.2.1. The API and functionality is pretty much identical to "native" patches. The main reason to use functions in this case is it will use server-side apply, which should take care of this for you. |
Beta Was this translation helpful? Give feedback.
@nicks Try switching to composition functions, and using https://marketplace.upbound.io/functions/crossplane-contrib/function-patch-and-transform/v0.2.1.
The API and functionality is pretty much identical to "native" patches. The main reason to use functions in this case is it will use server-side apply, which should take care of this for you.