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

ovs: Add port setting options #57

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chenyunchen
Copy link
Contributor

@chenyunchen chenyunchen commented Jun 8, 2018

ovs-vsctl --format=json set port bond0 vlan_mode=trunk trunk=1,2,3,4,5
ovs-vsctl --format=json get port bond0 tag vlan_mode trunk

[]          // If the option is not exist, OVS will return "[]\n"
trunk       // If the option is not exist, OVS will return "[]\n"
[1,2,3,4,5] // If the option is not exist, OVS will return "[]\n"

Only support the tag, vlan_mode, trunk option at this point.
All fields in PortOptions structs are pointers.

type PortOptions struct {
	Tag      *int
	VLANMode *string
	Trunk    []int
}
...
// Tag will be 0 if we just use init without pointer
err := c.VSwitch.Set.Port(port, PortOptions{
	VLANMode: vlanMode,
	Trunk:    trunk,
})

Or having an init function to create PortOptions. Any idea?

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.

1 participant