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

[IPv6] Add IPv6 support in NetworkPolicy #1272

Closed
wants to merge 22 commits into from

Conversation

wenyingd
Copy link
Contributor

Add support for IPv6 addresses in Network Policy.

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

Codecov Report

Merging #1272 into ipv6 will increase coverage by 0.05%.
The diff coverage is 70.31%.

Impacted file tree graph

@@            Coverage Diff             @@
##             ipv6    #1272      +/-   ##
==========================================
+ Coverage   57.88%   57.93%   +0.05%     
==========================================
  Files         155      155              
  Lines       13034    13164     +130     
==========================================
+ Hits         7545     7627      +82     
- Misses       4685     4726      +41     
- Partials      804      811       +7     
Flag Coverage Δ
#kind-e2e-tests 45.95% <44.14%> (-0.27%) ⬇️
#unit-tests 41.72% <55.32%> (+0.18%) ⬆️

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

Impacted Files Coverage Δ
pkg/antctl/transform/common/transform.go 0.00% <0.00%> (ø)
pkg/apis/controlplane/helper.go 0.00% <0.00%> (ø)
pkg/apis/controlplane/v1beta1/sets.go 36.76% <0.00%> (ø)
pkg/agent/openflow/client.go 42.22% <44.44%> (+0.36%) ⬆️
pkg/apis/controlplane/v1beta1/helper.go 38.46% <50.00%> (-7.70%) ⬇️
pkg/util/ip/ip.go 68.42% <55.55%> (+1.75%) ⬆️
pkg/ovs/openflow/ofctrl_builder.go 59.12% <66.66%> (+0.08%) ⬆️
pkg/agent/openflow/network_policy.go 68.55% <68.85%> (-0.63%) ⬇️
pkg/agent/openflow/pipeline.go 61.44% <75.59%> (+0.68%) ⬆️
pkg/agent/controller/networkpolicy/reconciler.go 67.13% <100.00%> (+0.47%) ⬆️
... and 6 more

@wenyingd wenyingd force-pushed the ipv6_networkpolicy branch 2 times, most recently from ffc1e77 to 90d2f6c Compare September 23, 2020 13:40
@wenyingd
Copy link
Contributor Author

/test-ipv6-e2e

@wenyingd wenyingd force-pushed the ipv6_networkpolicy branch 2 times, most recently from 0297228 to 82870ac Compare September 25, 2020 11:10
@wenyingd wenyingd changed the title [WIP][IPv6] Add enhancement in NetworkPolicy to support IPv6 [IPv6] Add enhancement in NetworkPolicy to support IPv6 Sep 25, 2020
@wenyingd wenyingd force-pushed the ipv6_networkpolicy branch 2 times, most recently from 9969d93 to 62043fb Compare September 28, 2020 11:36
@wenyingd
Copy link
Contributor Author

/test-ipv6-e2e
/test-ipv6-only-e2e

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.

Would you consider changing the commit message to: Add IPv6 support for NetworkPolicy

@@ -57,7 +57,7 @@ type GroupMemberPod struct {
// Pod maintains the reference to the Pod.
Pod *PodReference
// IP maintains the IPAddress of the Pod.
IP IPAddress
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems an incompatible API group change. @tnqn

Copy link
Member

Choose a reason for hiding this comment

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

Yes, unversioned type can be changed any time, but v1beta1 type cannot be changed in this way directly. otherwise it breaks backwards compatibility. I think v1beta2.GroupMember supports multiple IPs per Pod, you could base on it.

Copy link
Contributor

Choose a reason for hiding this comment

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

The controlplane.v1beta2 API is here #1405

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Having some offline discussion with Quan, I will rebase the change on v1beta2. Since the PR to upgrade v1beta1 to v1beta2 is not merged yet, will rebase the code after that PR is ready.

pkg/agent/openflow/pipeline.go Outdated Show resolved Hide resolved
@wenyingd wenyingd changed the title [IPv6] Add enhancement in NetworkPolicy to support IPv6 [IPv6] Add IPv6 support in NetworkPolicy Sep 29, 2020
@wenyingd wenyingd requested a review from tnqn September 29, 2020 12:25
@wenyingd
Copy link
Contributor Author

/test-all
/test-ipv6-e2e

@codecov-io
Copy link

codecov-io commented Oct 12, 2020

Codecov Report

Merging #1272 into ipv6 will decrease coverage by 17.07%.
The diff coverage is 62.70%.

Impacted file tree graph

@@             Coverage Diff             @@
##             ipv6    #1272       +/-   ##
===========================================
- Coverage   58.95%   41.87%   -17.08%     
===========================================
  Files         157       85       -72     
  Lines       13072    10734     -2338     
===========================================
- Hits         7706     4495     -3211     
- Misses       4552     5838     +1286     
+ Partials      814      401      -413     
Flag Coverage Δ
#kind-e2e-tests ?
#unit-tests 41.87% <62.70%> (+0.34%) ⬆️

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

Impacted Files Coverage Δ
pkg/agent/util/net.go 35.89% <ø> (-16.38%) ⬇️
pkg/apis/controlplane/helper.go 0.00% <0.00%> (ø)
pkg/apis/controlplane/sets.go 0.00% <0.00%> (-15.39%) ⬇️
pkg/agent/openflow/client.go 10.92% <22.22%> (-30.95%) ⬇️
pkg/util/ip/ip.go 67.24% <41.66%> (-12.39%) ⬇️
...ntroller/networkpolicy/networkpolicy_controller.go 70.22% <50.00%> (-11.15%) ⬇️
pkg/agent/openflow/pipeline.go 25.19% <62.12%> (-38.22%) ⬇️
pkg/agent/openflow/network_policy.go 63.09% <70.68%> (-10.45%) ⬇️
pkg/agent/controller/networkpolicy/reconciler.go 67.74% <100.00%> (-1.43%) ⬇️
pkg/agent/agent_linux.go 0.00% <0.00%> (-100.00%) ⬇️
... and 125 more

@lzhecheng
Copy link
Contributor

/test-ipv6-networkpolicy
/test-ipv6-only-networkpolicy

Copy link
Contributor

@abhiraut abhiraut left a comment

Choose a reason for hiding this comment

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

minor comment in addition to the changes needed to support v1beta2 for control plane APIs

@lzhecheng
Copy link
Contributor

/test-ipv6-networkpolicy
/test-ipv6-only-networkpolicy

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