Skip to content
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

Making the core and apps GO types compatible with kubebuilder-based CRD generation #2

Draft
wants to merge 3 commits into
base: feature-logical-clusters
Choose a base branch
from

Conversation

davidfestal
Copy link
Member

This Draft PR isn't expected to be merged, but is a reference of what has to be changed in the legacy scheme core/v1 and apps/v1 GO type definitions in order to allow generating, with the kubebuilder controller-gen tool, CRDs that can be successfully applied to a minimal apiserver like KCP.

This also required adding listType and listMapKeys annotations at all the places where patchStrategy and/or patchMergeKey were used, in order to have them correctly set when generating corresponding patchStrategy
and patchMergeKey kubernetes extensions in openapiv2 definitions generated from CRDs
(when legacy scheme resources are generated from CRDs) (see this change )
Having all the expected patchStrategy and patchMergeKey annotations in the CRD generated openapiV2 schema
is critical to enable Strategic Merge Patch for custom resources.

An example of CRDs generated by kubebuilder controller-gen based on these changes can be found in PR 4 in the kcp GH repository.

... to allow `controller-gen`  to generate CRDs
in `core` and `apps` groups

Signed-off-by: David Festal <[email protected]>
... in `core` and `apps` groups, in order to
have them to generate corresponding `patchStrategy`
and `patchMergeKey` kubernetes extensions in
openapiv2 definitions generated from CRDs
(when legacy scheme resources are generated
from CRDs)

Signed-off-by: David Festal <[email protected]>
... since they are used as `patchMergeKey` and
in the newly-added `listMapKeys`

Signed-off-by: David Festal <[email protected]>
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.

1 participant