digitalocean / go-openvswitch

Go packages which enable interacting with Open vSwitch and related tools. Apache 2.0 Licensed.
Other
295 stars 95 forks source link

ovs: ability to set other-config on bridge #61

Open breakintheweb opened 5 years ago

breakintheweb commented 5 years ago

I see that we can only set openflow protocols as bridge options.

// Bridge sets configuration for a bridge using the values from a BridgeOptions
// struct.
func (v *VSwitchSetService) Bridge(bridge string, options BridgeOptions) error {
        // Prepend command line arguments before expanding options slice
        // and appending it
        args := []string{"set", "bridge", bridge}
        args = append(args, options.slice()...)
        log.Println(args)
        _, err := v.v.exec(args...)
        return err
}

Would it be possible to add another method to allow for setting something like "other-config:forward-bpdu=true", or possibly extend the BridgeOptions struct to allow 'other-options'

// BridgeOther allows for setting of non openflow BridgeOptions
func (v *VSwitchSetService) BridgeOther(bridge string, options string) error {
        // Prepend command line arguments before expanding options string
        // and appending it
        args := []string{"set", "bridge", bridge}
        args = append(args, options)
        _, err := v.v.exec(args...)
        return err
}

Thanks!