k8snetworkplumbingwg / ovs-cni

Open vSwitch CNI plugin
Apache License 2.0
224 stars 71 forks source link

Provides a possible way to set interface's type of one port #252

Closed wangyueyu64 closed 1 year ago

wangyueyu64 commented 2 years ago

In the current code, only the 'internal' type which is also the defaut type of interface is available when ovs-cni create one interface for port. I added extra content to provides a possible way of setting interface's type when cni call func 'attachIfaceToBridge’. In order to accommodate this function, also expanded type NetConf for ovs-cni and added extra arguments to function ‘attachIfaceToBridge'. This will allow the user to select a custom type of interface when creating a port on bridge.

Signed-off-by: wangyueyu wangyueyu@didiglobal.com

What this PR does / why we need it:

Special notes for your reviewer:

Release note:

kubevirt-bot commented 2 years ago

Hi @wangyueyu64. Thanks for your PR.

I'm waiting for a k8snetworkplumbingwg member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
wangyueyu64 commented 2 years ago

The code looks fine. Would you please add test cases to https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/pkg/plugin/plugin_test.go covering the default type (without interface_type passed) and one for a custom type?

Thank you for your reply. I will supplement the test content as soon as possible.

wangyueyu64 commented 2 years ago

The code looks fine. Would you please add test cases to https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/pkg/plugin/plugin_test.go covering the default type (without interface_type passed) and one for a custom type?

Add new test content for interface type.

phoracek commented 2 years ago

/test pull-e2e-ovs-cni

phoracek commented 2 years ago

The test fails on the CI, probably due to afxdp support not being present in a default installation of OVS. I tried it locally and it also failed. Reading https://docs.openvswitch.org/en/latest/intro/install/afxdp/, it mentions that this specific type is experimental and compiled by default.

Could we change the type used in tests to one that is generally supported? To make sure that these tests can be executed on regular environments of other developers. system type may be a good choice. Edit: Even though, for system you may need to create a dummy interface first. So perhaps we could use TAP?

phoracek commented 1 year ago

@wangyueyu64 hello, this has been silent for a while. Can I help with anything regarding the tests?

wangyueyu64 commented 1 year ago

I am very sorry that I have replied to your message only now due to work reasons. I will use more general interface types as test cases, such as tap or system. I will submit it again after the modification is completed.

---Original--- From: "Petr @.> Date: Mon, Dec 12, 2022 20:21 PM To: @.>; Cc: @.**@.>; Subject: Re: [k8snetworkplumbingwg/ovs-cni] Provides a possible way to setinterface's type of one port (PR #252)

@wangyueyu64 hello, this has been silent for a while. Can I help with anything regarding the tests?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

phoracek commented 1 year ago

That's all good, don't worry about that :)

wangyueyu64 commented 1 year ago

The afxdp type interface content in the test file has been replaced with the interface of type system.

phoracek commented 1 year ago

/retest

kubevirt-bot commented 1 year ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: phoracek, wangyueyu64

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/k8snetworkplumbingwg/ovs-cni/blob/main/OWNERS)~~ [phoracek] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
phoracek commented 1 year ago

/release-note-none