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 parameter to disable default vlan #875

Merged
merged 1 commit into from Apr 17, 2023

Conversation

mlguerrero12
Copy link
Member

This new parameter allows users to remove the default vlan

Fixes: #667

@mlguerrero12 mlguerrero12 force-pushed the adddefaultvlanparam branch 2 times, most recently from 7760bc0 to 1203127 Compare March 31, 2023 16:44
@mlguerrero12 mlguerrero12 force-pushed the adddefaultvlanparam branch 2 times, most recently from 18dc732 to 5428eeb Compare April 3, 2023 11:24
Copy link

@phoracek phoracek left a comment

Choose a reason for hiding this comment

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

Minor notes. I like the new API and its defaults. I think this is the right way forward - fixing the behavior so it works as one would expect, while still allowing people who may rely on the faulty side-effect to use it

HairpinMode bool `json:"hairpinMode"`
PromiscMode bool `json:"promiscMode"`
Vlan int `json:"vlan"`
PreserveDefaultVlan bool `json:"preserveDefaultVlan"`
Copy link

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Should this be a *bool to preserve the existing behavior?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's another option.

Right now, the default value of this parameter is set to true in line 98 (before unmarshaling the config). So, users have to explicitly set it to false to disable it. If it is not present, the value is set to true.

I didn't want this param to be different than the others, that's why I didn't want to do it with a pointer. Also, because it will need an additional check.

plugins/main/bridge/bridge_test.go Outdated Show resolved Hide resolved
plugins/main/bridge/bridge_test.go Show resolved Hide resolved
plugins/main/bridge/bridge.go Show resolved Hide resolved
@mlguerrero12 mlguerrero12 force-pushed the adddefaultvlanparam branch 3 times, most recently from 6532d58 to 58e441c Compare April 3, 2023 14:02
Copy link
Contributor

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

some nits and a question.

Code looks good.

plugins/main/bridge/bridge_test.go Outdated Show resolved Hide resolved
plugins/main/bridge/bridge_test.go Outdated Show resolved Hide resolved
plugins/main/bridge/bridge_test.go Outdated Show resolved Hide resolved
@mlguerrero12 mlguerrero12 force-pushed the adddefaultvlanparam branch 2 times, most recently from 38a8b1b to 7e50dd4 Compare April 3, 2023 16:03
@maiqueb
Copy link
Contributor

maiqueb commented Apr 4, 2023

Thank you @mlguerrero12. The only think holding back the lgtm (from my perspective) is documenting the new attribute in the README.

Copy link
Contributor

@maiqueb maiqueb left a comment

Choose a reason for hiding this comment

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

@mlguerrero12 I had forgotten the README is defined in a separate project.

This looks good to me. Please address the other reviewers comments.

This new parameter allows users to remove the default vlan

Fixes: containernetworking#667
Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
@mlguerrero12
Copy link
Member Author

@squeed, @mccv1r0, could you please review this PR?

mlguerrero12 added a commit to mlguerrero12/cni.dev that referenced this pull request Apr 14, 2023
Linked to containernetworking/plugins#875

Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
@mlguerrero12
Copy link
Member Author

@phoracek, @maiqueb, please have a look at containernetworking/cni.dev#119

Copy link
Contributor

@s1061123 s1061123 left a comment

Choose a reason for hiding this comment

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

/lgtm

@squeed squeed merged commit 9f1f9a5 into containernetworking:main Apr 17, 2023
5 checks passed
phoracek added a commit to phoracek/cluster-network-addons-operator that referenced this pull request May 23, 2023
This bump brings in containernetworking/plugins#875

This change is required to improve the VLAN isolation done by bridge
CNI. This bump is unorthodox since it does not only cherry-pick the bug
fix, but also a few other patches. This is due to the lack of a stable
branch in CNI plugins. We reviewed the parasiting patches that are
introduced by this bump and evaluated that they are not disruptive to
our typical use of the bridge CNI.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209318

Signed-off-by: Petr Horacek <hrck@protonmail.com>
oshoval pushed a commit to oshoval/cluster-network-addons-operator that referenced this pull request Jun 19, 2023
This bump brings in containernetworking/plugins#875

This change is required to improve the VLAN isolation done by bridge
CNI. This bump is unorthodox since it does not only cherry-pick the bug
fix, but also a few other patches. This is due to the lack of a stable
branch in CNI plugins. We reviewed the parasiting patches that are
introduced by this bump and evaluated that they are not disruptive to
our typical use of the bridge CNI.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209318

Signed-off-by: Petr Horacek <hrck@protonmail.com>
kubevirt-bot pushed a commit to kubevirt/cluster-network-addons-operator that referenced this pull request Jun 26, 2023
This bump brings in containernetworking/plugins#875

This change is required to improve the VLAN isolation done by bridge
CNI. This bump is unorthodox since it does not only cherry-pick the bug
fix, but also a few other patches. This is due to the lack of a stable
branch in CNI plugins. We reviewed the parasiting patches that are
introduced by this bump and evaluated that they are not disruptive to
our typical use of the bridge CNI.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209318

Signed-off-by: Petr Horacek <hrck@protonmail.com>
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.

bridge: remove default pvid for veth interface
5 participants