feat: Use server-side apply to create and patch owned resources #2039
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.
Server-side apply has been introduced to improve co-operation of controllers, in defining the desire state for shared resources.
We previously implemented a custom strategy, relying on a combination of merge patch and pruning of nil values, but that fails to leverage the semantic provided by the strategic merge patch field markers, as strategic merge patch is not supported by CRDs, like Knative Service.
With server-side apply, markers can be applied to data structures (Lists, Maps), to make valid and finer-grained merge strategies.
This particularly helps cooperation of the Camel K operator with its Knative counterpart, into updating the Knative service pod template fields, such as the
Env []EnvVar
field, that declares the+patchStrategy=merge
marker, which translates into the server-side applylistType
and+listMapKey
markers.Release Note