Skip to content

Commit

Permalink
Fixing review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Anil Vishnoi <avishnoi@redhat.com>
  • Loading branch information
vishnoianil committed Aug 3, 2020
1 parent c2567bb commit e969892
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions go-controller/pkg/cni/helper_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ func (pr *PodRequest) ConfigureInterface(namespace string, podName string, ifInf
func waitForPodFlows(mac string) error {

return wait.PollImmediate(200*time.Millisecond, 20*time.Second, func() (bool, error) {
//Query the flows by mac address and count the number of flows.
// Query the flows by mac address
query := fmt.Sprintf("table=9,dl_src=%s",mac)
//ovs-ofctl dumps error on stderr, so stdout will only dump flow data if matches the query.
// ovs-ofctl dumps error on stderr, so stdout will only dump flow data if matches the query.
stdout, err := ofctlExec("dump-flows", "br-int", query)
if err != nil {
return false, nil
Expand Down
4 changes: 2 additions & 2 deletions go-controller/pkg/cni/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ func ofctlExec(args ...string) (string, error) {
stderrStr := string(stderr.Bytes())

if err != nil {
klog.V(5).Infof("exec: stderr: %q", stderrStr)
klog.V(5).Infof("exec(ovs-ofctl): stderr: %q", stderrStr)
return "", fmt.Errorf("failed to run 'ovs-ofctl %s': %v\n %q", cmdStr, err, string(stderr.Bytes()))
}
klog.V(5).Infof("exec: stdout: %q", stdoutStr)
klog.V(5).Infof("exec(ovs-ofctl): stdout: %q", stdoutStr)

trimmed := strings.TrimSpace(stdoutStr)
// If output is a single line, strip the trailing newline
Expand Down

0 comments on commit e969892

Please sign in to comment.