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

Add legacy networking API group for backward compatibility #1243

Merged
merged 1 commit into from
Sep 17, 2020

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Sep 14, 2020

Package networking is superseded by package controlplane in v0.9.3, to keep backward compatibility with up to two minor versions of antrea-agents, the API group should remain for two more minor releases.

This patch adds the APIs back and serves them with the same storage as controlplane API. Also, kind tests are added to make sure basic functionalities are not broken when only controller is upgraded.

Fixes #1250

@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 14, 2020

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1243      +/-   ##
==========================================
+ Coverage   56.26%   56.28%   +0.01%     
==========================================
  Files         109      109              
  Lines       12037    12045       +8     
==========================================
+ Hits         6773     6779       +6     
  Misses       4674     4674              
- Partials      590      592       +2     
Flag Coverage Δ
#integration-tests 46.05% <ø> (+0.03%) ⬆️
#unit-tests 42.55% <ø> (ø)

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

Impacted Files Coverage Δ
pkg/apis/controlplane/v1beta1/conversion.go 42.85% <ø> (ø)
pkg/apiserver/certificate/cacert_controller.go 17.58% <ø> (ø)
pkg/agent/proxy/types/types.go

@tnqn tnqn force-pushed the api-compat branch 2 times, most recently from 58802ea to 7e94f96 Compare September 14, 2020 10:28
@tnqn
Copy link
Member Author

tnqn commented Sep 14, 2020

/test-all

@tnqn
Copy link
Member Author

tnqn commented Sep 14, 2020

/test-windows-networkpolicy

@tnqn
Copy link
Member Author

tnqn commented Sep 14, 2020

@jianjuns @antoninbas In addition to the basic compatibility test added in this PR, I have manually verified that 0.7.0 and 0.8.0 agent + this PR's controller can pass networkpolicy and conformance tests.

I think ideally we should support backward compatibility for all clients including antctl but not sure if we want to make an exception for this particular renaming, do you want me to add the APIService back to support antctl of previous versions? We may document the compatibility of Antrea components whatever the decision is.

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.

Overall changes LGTM. I assume that everything in the diff that's not related to testing is just you adding back code that was previously deleted?

I am in favor of adding back the APIService to provide backwards-compatibility for antctl as well, unless you see an issue with it.

Even though I'll include information in the release notes, we need to start a document with a list of our APIs and the deprecation status when applicable. It can be pretty basic for now and we can improve it over time. It doesn't have to be as part of this PR either.

.github/workflows/kind_upgrade.yml Outdated Show resolved Hide resolved
.github/workflows/kind_upgrade.yml Outdated Show resolved Hide resolved
hack/generate-manifest.sh Show resolved Hide resolved
pkg/apiserver/apiserver.go Outdated Show resolved Hide resolved
ci/kind/test-upgrade-antrea.sh Show resolved Hide resolved
Copy link
Member Author

@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.

@antoninbas thanks for the input. I added the APIService back, will document the APIs in a separate PR.

.github/workflows/kind_upgrade.yml Outdated Show resolved Hide resolved
.github/workflows/kind_upgrade.yml Outdated Show resolved Hide resolved
ci/kind/test-upgrade-antrea.sh Show resolved Hide resolved
hack/generate-manifest.sh Show resolved Hide resolved
pkg/apiserver/apiserver.go Outdated Show resolved Hide resolved
@tnqn
Copy link
Member Author

tnqn commented Sep 15, 2020

I assume that everything in the diff that's not related to testing is just you adding back code that was previously deleted?

There is a little difference in "pkg/apis/networking" and "apiserver.go" compared with previously deleted code. It's reusing the controlplane storages and structs instead of its owns.

@tnqn
Copy link
Member Author

tnqn commented Sep 15, 2020

/test-all

@tnqn
Copy link
Member Author

tnqn commented Sep 15, 2020

/test-e2e

@tnqn tnqn added this to the Antrea v0.10.0 release milestone Sep 15, 2020
@tnqn tnqn added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API. label Sep 15, 2020
@tnqn
Copy link
Member Author

tnqn commented Sep 15, 2020

/test-conformance

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.

couple nits, otherwise LGTM

hack/generate-manifest.sh Outdated Show resolved Hide resolved
hack/generate-manifest.sh Outdated Show resolved Hide resolved
@tnqn
Copy link
Member Author

tnqn commented Sep 16, 2020

/test-all

antoninbas
antoninbas previously approved these changes Sep 16, 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

@tnqn
Copy link
Member Author

tnqn commented Sep 17, 2020

@jianjuns will you review this? if not I'd like to merge this soon as it's needed for upgrade tests of other api-change PRs.

@tnqn
Copy link
Member Author

tnqn commented Sep 17, 2020

/test-windows-networkpolicy

1 similar comment
@tnqn
Copy link
Member Author

tnqn commented Sep 17, 2020

/test-windows-networkpolicy

jianjuns
jianjuns previously approved these changes Sep 17, 2020
Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

LGTM. Just a NIT.

pkg/apis/networking/v1beta1/conversion.go Outdated Show resolved Hide resolved
Package networking is superseded by package controlplane in v0.9.3, to
keep backward compatibility with up to two minor versions of
antrea-agents, the API group should remain for two more minor releases.

This patch adds the APIs back and serves them with the same storage as
controlplane API. Also, kind tests are added to make sure basic
functionalities are not broken when only controller is upgraded.
@tnqn
Copy link
Member Author

tnqn commented Sep 17, 2020

/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 after typo fix

@tnqn
Copy link
Member Author

tnqn commented Sep 17, 2020

/test-windows-networkpolicy

@tnqn tnqn merged commit fd47097 into antrea-io:master Sep 17, 2020
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 22, 2020
…#1243)

Package networking is superseded by package controlplane in v0.9.3, to
keep backward compatibility with up to two minor versions of
antrea-agents, the API group should remain for two more minor releases.

This patch adds the APIs back and serves them with the same storage as
controlplane API. Also, kind tests are added to make sure basic
functionalities are not broken when only controller is upgraded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

antrea-controller should be backward compatible with antrea-agent to allow graceful upgrade
6 participants