Skip to content

Commit

Permalink
underlay: do not delete patch ports created by ovn-controller (#2851)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Jun 3, 2023
1 parent 5bb5f45 commit e5a1356
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/build-x86-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,10 @@ jobs:
run: make kube-ovn-conformance-e2e

- name: Cleanup
run: sh dist/images/cleanup.sh
run: |
if [ "${{ matrix.mode }}" != underlay ]; then
sh -x dist/images/cleanup.sh
fi
kube-ovn-ic-conformance-e2e:
name: Kube-OVN IC Conformance E2E
Expand Down
7 changes: 7 additions & 0 deletions pkg/daemon/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ func ovsCleanProviderNetwork(provider string) error {
// remove host nic from the external bridge
if output != "" {
for _, port := range strings.Split(output, "\n") {
// patch port created by ovn-controller has an external ID ovn-localnet-port=localnet.<SUBNET>
if output, err = ovs.Exec("--data=bare", "--no-heading", "--columns=_uuid", "find", "port", "name="+port, `external-ids:ovn-localnet-port!=""`); err != nil {
return fmt.Errorf("failed to find ovs port %s, %v: %q", port, err, output)
}
if output != "" {
continue
}
klog.V(3).Infof("removing ovs port %s from bridge %s", port, brName)
if err = removeProviderNic(port, brName); err != nil {
errMsg := fmt.Errorf("failed to remove port %s from external bridge %s: %v", port, brName, err)
Expand Down

0 comments on commit e5a1356

Please sign in to comment.