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

ut: ovn sb suite #4549

Merged
merged 10 commits into from
Sep 27, 2024
3 changes: 3 additions & 0 deletions pkg/controller/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type Configuration struct {
OvnSbAddr string
OvnTimeout int
OvsDbConnectTimeout int
OvsDbConnectMaxRetry int
OvsDbInactivityTimeout int
CustCrdRetryMaxDelay int
CustCrdRetryMinDelay int
Expand Down Expand Up @@ -118,6 +119,7 @@ func ParseFlags() (*Configuration, error) {
argOvnSbAddr = pflag.String("ovn-sb-addr", "", "ovn-sb address")
argOvnTimeout = pflag.Int("ovn-timeout", 60, "The seconds to wait ovn command timeout")
argOvsDbConTimeout = pflag.Int("ovsdb-con-timeout", 3, "The seconds to wait ovsdb connect timeout")
argOvsDbConnectMaxRetry = pflag.Int("ovsdb-con-maxretry", 60, "The maximum number of retries for connecting to ovsdb")
argOvsDbInactivityTimeout = pflag.Int("ovsdb-inactivity-timeout", 10, "The seconds to wait ovsdb inactivity check timeout")
argCustCrdRetryMinDelay = pflag.Int("cust-crd-retry-min-delay", 1, "The min delay seconds between custom crd two retries")
argCustCrdRetryMaxDelay = pflag.Int("cust-crd-retry-max-delay", 20, "The max delay seconds between custom crd two retries")
Expand Down Expand Up @@ -209,6 +211,7 @@ func ParseFlags() (*Configuration, error) {
OvnSbAddr: *argOvnSbAddr,
OvnTimeout: *argOvnTimeout,
OvsDbConnectTimeout: *argOvsDbConTimeout,
OvsDbConnectMaxRetry: *argOvsDbConnectMaxRetry,
OvsDbInactivityTimeout: *argOvsDbInactivityTimeout,
CustCrdRetryMinDelay: *argCustCrdRetryMinDelay,
CustCrdRetryMaxDelay: *argCustCrdRetryMaxDelay,
Expand Down
5 changes: 4 additions & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,14 +519,17 @@ func Run(ctx context.Context, config *Configuration) {
config.OvnNbAddr,
config.OvnTimeout,
config.OvsDbConnectTimeout,
config.OvsDbInactivityTimeout); err != nil {
config.OvsDbInactivityTimeout,
config.OvsDbConnectMaxRetry,
); err != nil {
util.LogFatalAndExit(err, "failed to create ovn nb client")
}
if controller.OVNSbClient, err = ovs.NewOvnSbClient(
config.OvnSbAddr,
config.OvnTimeout,
config.OvsDbConnectTimeout,
config.OvsDbInactivityTimeout,
config.OvsDbConnectMaxRetry,
); err != nil {
util.LogFatalAndExit(err, "failed to create ovn sb client")
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/ovn_ic_controller/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type Configuration struct {
OvnSbAddr string
OvnTimeout int
OvsDbConnectTimeout int
OvsDbConnectMaxRetry int
OvsDbInactivityTimeout int

NodeSwitch string
Expand All @@ -41,6 +42,7 @@ func ParseFlags() (*Configuration, error) {
argOvnSbAddr = pflag.String("ovn-sb-addr", "", "ovn-sb address")
argOvnTimeout = pflag.Int("ovn-timeout", 60, "")
argOvsDbConTimeout = pflag.Int("ovsdb-con-timeout", 3, "")
argOvsDbConnectMaxRetry = pflag.Int("ovsdb-con-maxretry", 60, "")
argOvsDbInactivityTimeout = pflag.Int("ovsdb-inactivity-timeout", 10, "")

argClusterRouter = pflag.String("cluster-router", util.DefaultVpc, "The router name for cluster router")
Expand Down Expand Up @@ -80,6 +82,7 @@ func ParseFlags() (*Configuration, error) {
OvnSbAddr: *argOvnSbAddr,
OvnTimeout: *argOvnTimeout,
OvsDbConnectTimeout: *argOvsDbConTimeout,
OvsDbConnectMaxRetry: *argOvsDbConnectMaxRetry,
OvsDbInactivityTimeout: *argOvsDbInactivityTimeout,

ClusterRouter: *argClusterRouter,
Expand Down
2 changes: 2 additions & 0 deletions pkg/ovn_ic_controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func NewController(config *Configuration) *Controller {
config.OvnTimeout,
config.OvsDbConnectTimeout,
config.OvsDbInactivityTimeout,
config.OvsDbConnectMaxRetry,
); err != nil {
util.LogFatalAndExit(err, "failed to create ovn nb client")
}
Expand All @@ -100,6 +101,7 @@ func NewController(config *Configuration) *Controller {
config.OvnTimeout,
config.OvsDbConnectTimeout,
config.OvsDbInactivityTimeout,
config.OvsDbConnectMaxRetry,
); err != nil {
util.LogFatalAndExit(err, "failed to create ovn sb client")
}
Expand Down
Loading
Loading