Feature Request: Dynamic change endpoints
halfcrazy opened this issue · 0 comments
halfcrazy commented
If ovsdb cluster scales up, there is no way to update endpoints without downtime. Eg ovn-nb as a daemonset on master nodes.
https://github.com/ovn-org/libovsdb/blob/main/client/client.go#L249-L259
for i, endpoint := range o.endpoints {
u, err := url.Parse(endpoint.address)
if err != nil {
return err
}
if sid, err := o.tryEndpoint(ctx, u); err != nil {
o.resetRPCClient()
connectErrors = append(connectErrors,
fmt.Errorf("failed to connect to %s: %w", endpoint.address, err))
continue
} else {
https://github.com/ovn-org/libovsdb/blob/main/client/client.go#L523-L532
// SetOption sets a new value for an option.
// It may only be called when the client is not connected
func (o *ovsdbClient) SetOption(opt Option) error {
o.rpcMutex.RLock()
defer o.rpcMutex.RUnlock()
if o.rpcClient != nil {
return fmt.Errorf("cannot set option when client is connected")
}
return opt(o.options)
}