Skip to content

Commit

Permalink
HACK: Use WIP libovsdb branch
Browse files Browse the repository at this point in the history
It enables compatibility mode to cope with schema changes. This has to
be revisited once/if the relevant PR get's merged:

ovn-org/libovsdb#244

Signed-off-by: Adrian Moreno <[email protected]>
  • Loading branch information
amorenoz committed Oct 13, 2021
1 parent d2ecd62 commit f4911cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 3 additions & 5 deletions go-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.13

require (
github.com/Mellanox/sriovnet v1.0.3-0.20210630121212-0453bd4b7fbc
github.com/Microsoft/go-winio v0.4.15 // indirect
github.com/Microsoft/hcsshim v0.8.10-0.20200715222032-5eafd1556990
github.com/alexflint/go-filemutex v0.0.0-20171022225611-72bdc8eae2ae
github.com/bhendo/go-powershell v0.0.0-20190719160123-219e7fb4e41e
Expand All @@ -26,9 +25,7 @@ require (
github.com/onsi/gomega v1.14.0
github.com/ovn-org/libovsdb v0.6.1-0.20210914134040-e4215434d1ba
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.1
github.com/prometheus/procfs v0.2.0 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
github.com/prometheus/client_golang v1.11.0
github.com/spf13/afero v1.4.1
github.com/stretchr/testify v1.7.0
github.com/urfave/cli/v2 v2.2.0
Expand All @@ -43,12 +40,13 @@ require (
k8s.io/apimachinery v0.22.0
k8s.io/client-go v0.22.0
k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92
k8s.io/klog/v2 v2.9.0
k8s.io/klog/v2 v2.10.1-0.20210803102611-4171f3c1be1b
k8s.io/utils v0.0.0-20210707171843-4b05e18ac7d9
)

replace (
github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
github.com/ovn-org/libovsdb => github.com/amorenoz/libovsdb v0.2.1-0.20211013063253-94fd06116518
k8s.io/api => k8s.io/api v0.22.0
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.0
k8s.io/apimachinery => k8s.io/apimachinery v0.22.0
Expand Down
5 changes: 3 additions & 2 deletions go-controller/pkg/util/libovsdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
// newClient creates a new client object given the provided config
// the stopCh is required to ensure the goroutine for ssl cert
// update is not leaked
func newClient(cfg config.OvnAuthConfig, dbModel *model.DBModel, stopCh <-chan struct{}) (client.Client, error) {
func newClient(cfg config.OvnAuthConfig, dbModel *model.DatabaseModelRequest, stopCh <-chan struct{}) (client.Client, error) {
options := []client.Option{
client.WithReconnect(OVSDBTimeout, &backoff.ZeroBackOff{}),
client.WithLeaderOnly(true),
Expand All @@ -48,6 +48,7 @@ func newClient(cfg config.OvnAuthConfig, dbModel *model.DBModel, stopCh <-chan s
options = append(options, client.WithTLSConfig(tlsConfig))
}

dbModel.SetCompatibility(true)
client, err := client.NewOVSDBClient(dbModel, options...)
if err != nil {
return nil, err
Expand Down Expand Up @@ -95,7 +96,7 @@ func NewNBClientWithConfig(cfg config.OvnAuthConfig, stopCh <-chan struct{}) (cl
return newClientWithMonitor(cfg, stopCh, dbModel)
}

func newClientWithMonitor(cfg config.OvnAuthConfig, stopCh <-chan struct{}, dbModel *model.DBModel) (client.Client, error) {
func newClientWithMonitor(cfg config.OvnAuthConfig, stopCh <-chan struct{}, dbModel *model.DatabaseModelRequest) (client.Client, error) {
c, err := newClient(cfg, dbModel, stopCh)
if err != nil {
return nil, err
Expand Down

0 comments on commit f4911cc

Please sign in to comment.