Skip to content

Commit

Permalink
ut: ovn sb suite (#4549)
Browse files Browse the repository at this point in the history
Signed-off-by: zcq98 <[email protected]>

---------

Signed-off-by: zcq98 <[email protected]>
  • Loading branch information
zcq98 authored and bobz965 committed Oct 25, 2024
1 parent 2f49ad2 commit 1ff0ceb
Show file tree
Hide file tree
Showing 26 changed files with 2,246 additions and 1,518 deletions.
9 changes: 1 addition & 8 deletions cmd/daemon/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,15 @@ import (
"fmt"
"os/exec"

"github.com/vishvananda/netlink"
"k8s.io/klog/v2"
)

<<<<<<< HEAD
=======
const (
geneveLinkName = "genev_sys_6081"
vxlanLinkName = "vxlan_sys_4789"
)

func printCaps() {
currentCaps := cap.GetProc()
klog.Infof("current capabilities: %s", currentCaps.String())
}

>>>>>>> 5a70de9c (allow user to set vxlan_sys_4789 tx off (#4543))
func initForOS() error {
// disable checksum for genev_sys_6081 as default
cmd := exec.Command("sh", "-c", "ethtool -K genev_sys_6081 tx off")
Expand Down
3 changes: 3 additions & 0 deletions pkg/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
CustCrdRetryMaxDelay int
CustCrdRetryMinDelay int
Expand Down Expand Up @@ -114,6 +115,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 @@ -203,6 +205,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 @@ -477,14 +477,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
4 changes: 0 additions & 4 deletions pkg/daemon/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,7 @@ func ParseFlags() *Configuration {
argUDPConnectivityCheckPort = pflag.Int32("udp-conn-check-port", 8101, "UDP connectivity Check Port")
argEnableTProxy = pflag.Bool("enable-tproxy", false, "enable tproxy for vpc pod liveness or readiness probe")
argOVSVsctlConcurrency = pflag.Int32("ovs-vsctl-concurrency", 100, "concurrency limit of ovs-vsctl")
<<<<<<< HEAD
=======
argEnableOVNIPSec = pflag.Bool("enable-ovn-ipsec", false, "Whether to enable ovn ipsec")
argSetVxlanTxOff = pflag.Bool("set-vxlan-tx-off", false, "Whether to set vxlan_sys_4789 tx off")
>>>>>>> 5a70de9c (allow user to set vxlan_sys_4789 tx off (#4543))
)

// mute info log for ipset lib
Expand Down
Loading

0 comments on commit 1ff0ceb

Please sign in to comment.