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

Refactor egress-v4-cni plugin to support unit testing #2353

Merged
merged 3 commits into from
Apr 26, 2023

Conversation

wanyufe
Copy link
Member

@wanyufe wanyufe commented Apr 19, 2023

What type of PR is this?
Refactor, no functions changes.

Which issue does this PR fix:
egress-cni plugin has no unit-testing code.

What does this PR do / Why do we need it:
Two reasons:

  1. Adding unit-testing to enhance code quality
  2. Prepare work for coming PR which supports ipv6 egress

If an issue # is not available please add repro steps and logs from IPAMD/CNI showing the issue:

Testing done on this change:

Manual testing, unit testing, and integration testing
Automation added to e2e:

Will this PR introduce any new dependencies?:

No
Will this break upgrades or downgrades. Has updating a running cluster been tested?:
No

Does this change require updates to the CNI daemonset config files to work?:

No
Does this PR introduce any user-facing change?:

No


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@jdn5126 jdn5126 left a comment

Choose a reason for hiding this comment

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

Refactor overall looks great, just some nits to help with structure. Main points are:

  1. Let's pull integration tests out and save that for a future PR
  2. Let's rename the share folder

Also, can you rebase this against HEAD of master branch and squash the commits down to 1? That will make it easier to review

cmd/egress-cni-plugin/cni/cni4.go Outdated Show resolved Hide resolved
cmd/egress-cni-plugin/cni/cni4.go Outdated Show resolved Hide resolved
cmd/egress-cni-plugin/cni/cni4.go Outdated Show resolved Hide resolved
cmd/egress-cni-plugin/cni/cni4.go Outdated Show resolved Hide resolved
cmd/egress-cni-plugin/cni/cni4_test.go Outdated Show resolved Hide resolved
pkg/ipamwrapper/ipam.go Outdated Show resolved Hide resolved
pkg/networkutils/network_test.go Outdated Show resolved Hide resolved
pkg/nswrapper/ns.go Outdated Show resolved Hide resolved
test/integration/cni/egress_connectivity_test.go Outdated Show resolved Hide resolved
test/integration/cni/run-integ.sh Outdated Show resolved Hide resolved
@wanyufe wanyufe marked this pull request as ready for review April 19, 2023 23:32
@wanyufe wanyufe requested a review from a team as a code owner April 19, 2023 23:32
Copy link
Contributor

@jdn5126 jdn5126 left a comment

Choose a reason for hiding this comment

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

One last nit, then this is good to go, thanks @wanyufe ! Also, can you squash this into one commit? That will make the history easier to read. After that, I can kick off manual integration test job and approve once it passes

cmd/egress-cni-plugin/main.go Outdated Show resolved Hide resolved
@wanyufe wanyufe force-pushed the egress-part-1 branch 2 times, most recently from 92113ee to 66ab916 Compare April 20, 2023 20:05
jdn5126
jdn5126 previously approved these changes Apr 21, 2023
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.

3 participants