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

wip: release-4.6: test ovn2.13-20.12.0-5.bz1839102.el8.fdn #415

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ RUN yum install -y \
selinux-policy && \
yum clean all

COPY ovn2.13-20.12.0-5.bz1839102.el8fdn.x86_64.rpm ovn2.13-central-20.12.0-5.bz1839102.el8fdn.x86_64.rpm ovn2.13-host-20.12.0-5.bz1839102.el8fdn.x86_64.rpm ovn2.13-vtep-20.12.0-5.bz1839102.el8fdn.x86_64.rpm /root/
RUN INSTALL_PKGS=" \
openssl firewalld-filesystem \
libpcap iproute strace \
Expand All @@ -44,6 +45,7 @@ RUN INSTALL_PKGS=" \
# openvswitch2.13-2.13.0-57.el8fdp
yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False "openvswitch2.13 == 2.13.0-57.el8fdp" "openvswitch2.13-devel == 2.13.0-57.el8fdp" && \
yum install -y --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False "ovn2.13 == 20.06.2-11.el8fdp" "ovn2.13-central == 20.06.2-11.el8fdp" "ovn2.13-host == 20.06.2-11.el8fdp" "ovn2.13-vtep == 20.06.2-11.el8fdp" && \
rpm -Uhv --force --nodeps /root/ovn2.13*.rpm && \
yum clean all && rm -rf /var/cache/*

RUN mkdir -p /var/run/openvswitch && \
Expand Down
2 changes: 1 addition & 1 deletion go-controller/pkg/cni/helper_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ func (pr *PodRequest) ConfigureInterface(namespace string, podName string, ifInf
klog.Warningf("Failed to settle addresses: %q", err)
}

if err = waitForPodFlows(ifInfo.MAC.String()); err != nil {
if err = waitForPodFlows(hostIface.Name); err != nil {
return nil, fmt.Errorf("timed out waiting for pod flows for pod: %s, error: %v", podName, err)
}

Expand Down
38 changes: 27 additions & 11 deletions go-controller/pkg/cni/ovs.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,17 @@ func ovsSet(table, record string, values ...string) error {
return err
}

func ovsGet(table, record, column, key string) (string, error) {
args := []string{"--if-exists", "get", table, record}
if key != "" {
args = append(args, fmt.Sprintf("%s:%s", column, key))
} else {
args = append(args, column)
}
output, err := ovsExec(args...)
return strings.Trim(strings.TrimSpace(string(output)), "\""), err
}

// Returns the given column of records that match the condition
func ovsFind(table, column, condition string) ([]string, error) {
output, err := ovsExec("--no-heading", "--format=csv", "--data=bare", "--columns="+column, "find", table, condition)
Expand Down Expand Up @@ -98,18 +109,23 @@ func ofctlExec(args ...string) (string, error) {
return stdoutStr, nil
}

func waitForPodFlows(mac string) error {
func isIfaceOvnInstalledSet(ifaceName string) error {
out, err := ovsGet("Interface", ifaceName, "external-ids", "ovn-installed")
if err == nil && out == "true" {
klog.V(5).Infof("Interface %s has ovn-installed=true", ifaceName)
return nil
}

// Try again
return fmt.Errorf("still waiting for OVS port %s to have ovn-installed", ifaceName)
}

func waitForPodFlows(ifaceName string) error {
return wait.PollImmediate(200*time.Millisecond, 20*time.Second, func() (bool, error) {
// 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.
stdout, err := ofctlExec("dump-flows", "br-int", query)
if err != nil {
return false, nil
}
if len(stdout) == 0 {
return false, nil
if err := isIfaceOvnInstalledSet(ifaceName); err == nil {
//success
return true, nil
}
return true, nil
return false, nil
})
}
Binary file added ovn2.13-20.12.0-5.bz1839102.el8fdn.x86_64.rpm
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.