Skip to content

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