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

Issue 329: CRD apiVersion check #330

Merged
merged 2 commits into from
May 24, 2021

Conversation

lspecian-olx
Copy link
Contributor

Change log description

  • Add the capability to install the chart in eks versions that don't support apiVersion=apiextensions.k8s.io/v1beta1 anymore

Purpose of the change

Closes #329

What the code does

The code is using .Capabilities.APIVersions.Has to check for the apiVersion apiextensions.k8s.io/v1, if it finds it it uses to create the CRD, if it doesn't it falls back to apiextensions.k8s.io/v1beta1

How to verify it

You are able to install the chart with the CRD in eks v1.19.0 version from which apiextensions.k8s.io/v1beta1 was removed

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2021

Codecov Report

Merging #330 (b2c9c4d) into master (a99c93b) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #330   +/-   ##
=======================================
  Coverage   84.67%   84.67%           
=======================================
  Files          11       11           
  Lines        1312     1312           
=======================================
  Hits         1111     1111           
  Misses        133      133           
  Partials       68       68           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a99c93b...b2c9c4d. Read the comment docs.

@anishakj
Copy link
Contributor

@lspecian-olx
Copy link
Contributor Author

@lspecian-olx Thanks for the contribution. Do we need similar check here as well https://github.com/lspecian-olx/zookeeper-operator/blob/issue-329-crd-apiversion-check/charts/zookeeper-operator/templates/pre-delete-hooks.yaml#L3 ?

Indeed we need a similar check as well, I made a new commit including the change

@anishakj anishakj requested a review from SrishT May 20, 2021 08:51
@anishakj
Copy link
Contributor

@lspecian-olx could you please address the review comment?

@lspecian-olx lspecian-olx force-pushed the issue-329-crd-apiversion-check branch from 5909a60 to c4eab90 Compare May 24, 2021 14:03
@lspecian-olx lspecian-olx force-pushed the issue-329-crd-apiversion-check branch from c4eab90 to b2c9c4d Compare May 24, 2021 14:04
Copy link
Contributor

@anishakj anishakj left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@SrishT SrishT left a comment

Choose a reason for hiding this comment

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

LGTM

@anishakj anishakj merged commit fd714b4 into pravega:master May 24, 2021
@anishakj
Copy link
Contributor

anishakj commented May 28, 2021

@lspecian-olx when i tried to install Operator on a cluster with v1.19.9 version, got the below error. Are you also seeing same?

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "additionalPrinterColumns" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "subresources" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "validation" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]

@lspecian-olx
Copy link
Contributor Author

@lspecian-olx when i tried to install Operator on a cluster with v1.19.9 version, got the below error. Are you also seeing same?

Error: unable to build kubernetes objects from release manifest: error validating "": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "additionalPrinterColumns" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "subresources" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "validation" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]

Yes, I'm also seeing the same, preparing a PR with a fix for the issue #338

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.

apiextensions.k8s.io/v1beta1 apiVersion removed on k8s v1.19.0
4 participants