Skip to content

Commit

Permalink
fix: ipv6 get portmap failed again
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Sep 21, 2020
1 parent 6289872 commit fae393e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/pinger/ovn.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ func checkOvsBindings() ([]string, error) {
}
result := make([]string, 0, len(strings.Split(string(output), "\n")))
for _, line := range strings.Split(string(output), "\n") {
result = append(result, strings.TrimPrefix(line, "iface-id="))
for _, id := range strings.Split(line, " ") {
if strings.Contains(id, "iface-id") {
result = append(result, strings.TrimPrefix(id, "iface-id="))
break
}
}
}
return result, nil
}
Expand Down Expand Up @@ -109,7 +114,7 @@ func checkSBBindings(config *Configuration) ([]string, error) {
klog.Infof("chassis id is %s", chassis)
output, err = exec.Command(
"ovn-sbctl",
fmt.Sprintf("--db=tcp:%s:%s", sbHost, sbPort),
fmt.Sprintf("--db=tcp:[%s]:%s", sbHost, sbPort),
"--format=csv",
"--no-heading",
"--data=bare",
Expand Down

0 comments on commit fae393e

Please sign in to comment.