Support legacy scheme resources as CRDs #7
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.
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:
at the right place and in the expected format both in
APIResources
endpoints and inside the OpenAPI v2 schema.
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 toinfer the equivalent
patchStrategy
andpatchMergeKey
extensionsin 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 thoseclient tools are hard-coded to use strategic merge patch when
modifying a legacy scheme resource.