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

Support legacy scheme resources as CRDs #7

Open
wants to merge 3 commits into
base: streamline
Choose a base branch
from
Open

Support legacy scheme resources as CRDs #7

wants to merge 3 commits into from

Conversation

davidfestal
Copy link

This PR enable adding legacy scheme resources as CRDs.

This may be useful in case when some legacy scheme resources
are not registered, which is the case for example in KCP.

It takes care of:

  • publishing the CRD-based legacy schema resources
    at the right place and in the expected format both in APIResources
    endpoints and inside the OpenAPI v2 schema.
  • forwarding the requests from the main apiserver to the crdHandler
    when legacy scheme resources have been added through CRDs.

It also introduces the support of strategic merge patch for CRDs,
based on the CRD published openapi v2 definitions.
This requires the CRD schemas to have all the expected listType
and listMapKeys k-kubernetes annotations, since we use them to
infer the equivalent patchStrategy and patchMergeKey extensions
in the generated openapi v2 schema.
SMP support for CRDs in this case is required to be compatible with
kubectl or other GO kubernetes clients, due to the fact that those
client tools are hard-coded to use strategic merge patch when
modifying a legacy scheme resource.

This may be useful in case when some legacy scheme resources
are not registered, which is the case for example in KCP.

There has to be special cases for `core` resources that
have an empty group and are at a dedicated api prefix.

This doesn't fully work with `kubectl` or kubernetes client,
due to the fact that those client tools sustematically use
strategic merge patch of legacy scheme resources, and CRDs
don't support strategic merge patch.
The fix for this limitation will be in a next commit.

Signed-off-by: David Festal <[email protected]>
... based on CRD published openapi v2 definitions
... to bypass issue kubernetes#85127
until we possibly rebase this branch to get the real fix.

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