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

fix: tap interface attach to bridge #479

Merged
merged 2 commits into from
Jul 12, 2022
Merged

fix: tap interface attach to bridge #479

merged 2 commits into from
Jul 12, 2022

Conversation

richardcase
Copy link
Member

@richardcase richardcase commented Jul 1, 2022

When requestinf that a tap device is added to a microvm then we should
attach (i.e. set the master) to a bridge.
What this PR does / why we need it:

The bridge will be supplied via the parent-iface flag. And the attach should not be done for the mmds network interface.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #478

Special notes for your reviewer:

Checklist:

  • squashed commits into logical changes
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

@richardcase richardcase added the kind/bug Something isn't working label Jul 1, 2022
@richardcase richardcase changed the title [WIP] fix: tap interface attach to bridge fix: tap interface attach to bridge Jul 8, 2022
@richardcase richardcase marked this pull request as ready for review July 8, 2022 13:54
Callisto13
Callisto13 previously approved these changes Jul 12, 2022
@@ -23,7 +23,9 @@ type NetworkInterface struct {
Type IfaceType `json:"type" validate:"oneof=tap macvtap unsupported"`
// StaticAddress is an optional static IP address to assign to this interface.
// If not supplied then DHCP will be used.
StaticAddress *StaticAddress `json:"staticAddress,omitempty"`
StaticAddress *StaticAddress `json:"staticAddrss,omitempty"`
// BranchName is the name of the Linux bridge to attach the TAP device to.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// BranchName is the name of the Linux bridge to attach the TAP device to.
// BridgeName is the name of the Linux bridge to attach the TAP device to.

Copy link
Member

Choose a reason for hiding this comment

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

guessing that will need a regenerate

Copy link
Member Author

Choose a reason for hiding this comment

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

Bugger, i had a real mental block between bridge name and branch name. Changing....

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed.

@@ -5,6 +5,11 @@ import (
"os"
)

// Validate will validate the Config.
func (c *Config) Validate() error {
Copy link
Member

Choose a reason for hiding this comment

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

is this for anything?

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed, i did start to go down a rabbit hole with validation and then came to my senses. This got accidentally left behind.

Copy link
Member

Choose a reason for hiding this comment

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

we can probs have a ticket for that

When requesting that a tap device is added to a microvm then we should
attach (i.e. set the master) to a bridge.

The bridge will be supplied via a new bridge-name flag. And the attach
should not be done for the mmds network interface.

The grpc api has been updated to allow the consumer to specify a
bridge-name that is different as part of the create microvm call.

Signed-off-by: Richard Case <[email protected]>
@richardcase richardcase merged commit d83c103 into liquidmetal-dev:main Jul 12, 2022
@richardcase richardcase deleted the tap_br_fix branch July 12, 2022 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TAP device doesn't attach to bridge
2 participants