Skip to content

Commit

Permalink
fix: add timeout to pinger access ovs/ovn
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Jan 8, 2020
1 parent 78a77d4 commit 8488ae2
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions pkg/pinger/ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func checkOvnController(config *Configuration) {
}

func checkPortBindings(config *Configuration) {
klog.Infof("start to check por binding")
klog.Infof("start to check port binding")
ovsBindings, err := checkOvsBindings()
if err != nil {
return
Expand Down Expand Up @@ -61,7 +61,16 @@ func checkPortBindings(config *Configuration) {
}

func checkOvsBindings() ([]string, error) {
output, err := exec.Command("ovs-vsctl", "--no-heading", "--data=bare", "--format=csv", "--columns=external_ids", "find", "interface", "external_ids:iface-id!=\"\"").CombinedOutput()
output, err := exec.Command(
"ovs-vsctl",
"--no-heading",
"--data=bare",
"--format=csv",
"--columns=external_ids",
"--timeout=10",
"find",
"interface",
"external_ids:iface-id!=\"\"").CombinedOutput()
if err != nil {
klog.Errorf("failed to get ovs interface %v", err)
return nil, err
Expand All @@ -83,6 +92,7 @@ func checkSBBindings(config *Configuration) ([]string, error) {
"--no-heading",
"--data=bare",
"--columns=_uuid",
"--timeout=10",
"find",
"chassis",
fmt.Sprintf("hostname=%s", config.NodeName)).CombinedOutput()
Expand All @@ -104,6 +114,7 @@ func checkSBBindings(config *Configuration) ([]string, error) {
"--no-heading",
"--data=bare",
"--columns=logical_port",
"--timeout=10",
"find",
"port_binding",
fmt.Sprintf("chassis=%s", chassis)).CombinedOutput()
Expand Down

0 comments on commit 8488ae2

Please sign in to comment.