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

Switch CRD apiVersion to v1 from v1beta1 #1009

Merged
merged 8 commits into from
Sep 24, 2020
Merged

Conversation

abhiraut
Copy link
Contributor

@abhiraut abhiraut commented Jul 31, 2020

apiVersion v1beta1 has been deprecated for CRDs in favor of v1.
This PR takes care of updating versions of all the CRDs available.
In addition to the version update, this PR also ensures strict schema validation for the following CRDs:

  • traceflow
  • clusternetworkpolicy
  • networkpolicy
  • externalentity
  • tier

Related-Issue: #684

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

These commands can only be run by members of the vmware-tanzu organization.

@abhiraut abhiraut changed the title V1beta1 Switch CRD apiVersion to v1 from v1beta1 Jul 31, 2020
@abhiraut
Copy link
Contributor Author

/test-all

@abhiraut
Copy link
Contributor Author

reopening the old PR.. by mistake renamed the branch and created a new one instead. closed the original PR #508

schema:
openAPIV3Schema:
type: object
x-kubernetes-preserve-unknown-fields: true
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this ensures original behavior. but imo we should update them to perform strict validation in a follow up for individual CRDs

@abhiraut
Copy link
Contributor Author

/test-all

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

"apiextensions.k8s.io/v1beta1" is deprecated in 1.19 but will not be removed until 1.22 (kubernetes/kubernetes#82022)

Unless the default K8s version for managed services for which we claim support (GKE, EKS) is updated before we release Antrea v0.9.0, I do not think we should merge this. In GKE, it seems the default K8s version is currently 1.15.12. In EKS, it seems that the default version is 1.17 (but 1.15 is still supported). So for Antrea v0.9.0, I believe we should target K8s 1.15 -> 1.19, and postpone merging this PR for v0.10.0.

This PR should also reference this issue: #684

@antoninbas
Copy link
Contributor

@abhiraut if you want to make that change for Antrea v0.10, it's ok with me. I see that the GKE stable channel is still using 1.15, but the regular channel is using 1.16.

@abhiraut
Copy link
Contributor Author

@abhiraut if you want to make that change for Antrea v0.10, it's ok with me. I see that the GKE stable channel is still using 1.15, but the regular channel is using 1.16.

thanks.. will spin out a new PR sometime today

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

@codecov-commenter
Copy link

codecov-commenter commented Sep 18, 2020

Codecov Report

Merging #1009 into master will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1009      +/-   ##
==========================================
+ Coverage   54.40%   54.49%   +0.08%     
==========================================
  Files         115      115              
  Lines       10807    10807              
==========================================
+ Hits         5880     5889       +9     
+ Misses       4353     4347       -6     
+ Partials      574      571       -3     
Flag Coverage Δ
#integration-tests 44.98% <ø> (+0.03%) ⬆️
#unit-tests 41.55% <ø> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/ovs/openflow/ofctrl_bridge.go 68.77% <0.00%> (+0.79%) ⬆️
pkg/apiserver/storage/ram/watch.go 88.46% <0.00%> (+3.84%) ⬆️
pkg/apiserver/certificate/certificate.go 77.63% <0.00%> (+6.57%) ⬆️

@abhiraut
Copy link
Contributor Author

/test-all

@abhiraut
Copy link
Contributor Author

/test-networkpolicy

@abhiraut
Copy link
Contributor Author

/skip-hw-offload

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

This LGTM, but let's get more reviews and ensure everyone is ok with this change, since it means we will not support K8s 1.16 any more

Besides that, any impact of adding OpenAPI validation schemas to the CRDs?

@jianjuns
Copy link
Contributor

This LGTM, but let's get more reviews and ensure everyone is ok with this change, since it means we will not support K8s 1.16 any more

I think it is that we no longer support K8s 1.15?

@antoninbas
Copy link
Contributor

Yes, that's a typo, we will no longer support 1.15, which is the K8s version used by GKE's "stable channel" (the "regular channel" uses 1.16).

tnqn
tnqn previously approved these changes Sep 23, 2020
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@abhiraut
Copy link
Contributor Author

This LGTM, but let's get more reviews and ensure everyone is ok with this change, since it means we will not support K8s 1.16 any more

Besides that, any impact of adding OpenAPI validation schemas to the CRDs?

I have added "x-kubernetes-preserve-unknown-fields: true" to the fields for CRDs which did not have schema defined before so that unknown fields are preserved. The other CRDs listed in PR description had schema which i translated to the new format.

antoninbas
antoninbas previously approved these changes Sep 23, 2020
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

LGTM

@abhiraut
Copy link
Contributor Author

/test-all

tnqn
tnqn previously approved these changes Sep 24, 2020
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM, one question inline

@@ -27,6 +31,10 @@ spec:
- name: v1beta1
served: true
storage: true
schema:
Copy link
Member

Choose a reason for hiding this comment

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

Is the a new field that is not present in v1beta1? want to check if a cluster that already uses antrea can upgrade to 0.10 by simply fixing apiextensions.k8s.io/v1beta1, or they need to fix all the CRD definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they do need to update the definition.. as there is some renaming "JSONPath -> jsonPath" and some fields no longer supported (preserveUnknownFields) and some fields have a different parent field (validation -> schema)

@abhiraut
Copy link
Contributor Author

/test-all

Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Approving again

@abhiraut abhiraut merged commit 4c6ecd0 into antrea-io:master Sep 24, 2020
@abhiraut abhiraut deleted the v1beta1 branch September 24, 2020 23:48
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.

7 participants