Skip to content

Conversation

@Diaphteiros
Copy link
Contributor

What this PR does / why we need it:
For the Gardener ClusterProvider, we want to be able to overwrite arbitrary fields of the generated shoot manifest via a ClusterConfig resource. An easy solution for this is by using JSON patches to describe the desired changes to the shoot manifest.

Since this functionality could be useful in further scenarios, I implemented it in the controller-utils library.

Which issue(s) this PR fixes:
Related to openmcp-project/backlog#12

Special notes for your reviewer:

Release note:

Added an `api` nested module to hold type definitions that can be reused in other repo's k8s api type definitions without having to import the whole controller-utils library into that repo's `api` module.
Added a library for handling JSON patches.

@Diaphteiros
Copy link
Contributor Author

I swapped the Any type for the JSON one from the apiserver-extensions package (although I'm not too happy about that dependency), removed the Ptr function and activated controller-gen for generating the DeepCopy functions.
@ValentinGerlach Please take a look again.

@Diaphteiros
Copy link
Contributor Author

OK, let me quickly evaluate using the kustomize type.

@Diaphteiros
Copy link
Contributor Author

I replaced our own json patch api type implementation with the kustomize one. I still kept the api module and created an alias for the type, though, because that makes it easier to consume the type and to adapt it, if we ever need to change something (which is unlikely).

Copy link
Member

@ValentinGerlach ValentinGerlach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for taking the extra time to validate the suggestions 🙏

@maximiliantech
Copy link
Member

@Diaphteiros Since you've made some adjustments in the codebase after the initial review by @ValentinGerlach, could you please update the PR description if necessary 🙏

@Diaphteiros Diaphteiros merged commit 4956eb6 into main Jul 7, 2025
7 checks passed
@Diaphteiros Diaphteiros deleted the jsonpatch branch July 7, 2025 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants