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

Update CustomResourceDefinition API version to v1 #104

Merged
merged 5 commits into from Nov 27, 2020

Conversation

miguelsorianod
Copy link
Contributor

@miguelsorianod miguelsorianod commented Nov 23, 2020

This PR updates the API Version of the CustomResourceDefinition API type from v1beta1 to v1 for our CRDs.
The motivation of this is that K8s is going to stop serving v1beta1 in K8s 1.22:

Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition

related issue: kubernetes/kubernetes#82022

It is important to not confuse the APIVersion of the CustomResourceDefinition API type with the APIVersion of our CRD Types. They are different concepts. In this PR we are dealing with the former.

The following changes have been performed:

  • Change controller-gen flags to generate v1 version of CustomResourceDefinition.
  • Update CRD Kustomize patch files to reference to CustomResourceDefinition v1
  • Update the CRD kustomize patch file that deals with adding anyOf OpenAPI validation of the APIcast configuration source to use JSON Patch instead of JSON Strategic Merge patch. The reason for this is that now that the OpenAPI validation appears in an array of versions there's no way to perform a merge with JSON Strategic Merge patch on the array element contents as it lacks a merge key definition
  • Update manifests and bundle CRDs with the new v1 CustomResourceDefinition format. The OpenAPI validation is now specified in the versions array instead of directly in the spec.
  • Update CRD manifest tests to use versioned retrieval of the CRD type schema.

… configsource

JSON strategic merge does not allow merging content to an array element when the array
does not have a mergeKey defined. We change to JSON Patch for the APIcast
configuration source patch that adds anyOf OpenAPI validation
@miguelsorianod miguelsorianod changed the title [WIP] Update CustomResourceDefinition API version to v1 Update CustomResourceDefinition API version to v1 Nov 25, 2020
@miguelsorianod miguelsorianod marked this pull request as ready for review November 25, 2020 17:47
@miguelsorianod miguelsorianod merged commit b04bd53 into master Nov 27, 2020
@miguelsorianod miguelsorianod deleted the update-crdtype-to-v1-version branch November 27, 2020 15:13
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.

None yet

2 participants