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

cni-server: wait ovs-vswitchd to be running #2759

Merged
merged 1 commit into from
May 6, 2023

Conversation

zhangzujian
Copy link
Member

What type of this PR

  • Bug fixes

Which issue(s) this PR fixes:

In #2516 we removed the IP/route transfer logic in start-ovs.sh and all underlay bridges will be deleted after the node reboot before ovs-vswitchd starts up. However, there is a chance that kube-ovn-cni starts before the bridge deletion completes, and uses a non-existent ovs bridge as the tunnel interface.

This patch fixes the bug by making kube-ovn-cni wait for ovs-vswitchd to run.

WHAT

copilot:summary

copilot:poem

HOW

copilot:walkthrough

@zhangzujian zhangzujian added bug Something isn't working need backport labels May 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2023

  • The script can be improved by adding a timeout to the while loop. If OVS_SOCK is not found within a certain amount of time, the script should exit with an error message.
  • Instead of using sleep(1) to wait for OVS_SOCK, it would be better to use inotifywait or a similar tool to monitor the file system for changes to the socket file.
  • The script should check if OVS_SOCK exists before entering the while loop. If it does not exist, the script should exit with an error message.
  • The echo statement inside the while loop should be removed or moved outside the loop to avoid unnecessary output.
  • It would be better to use a more descriptive variable name than OVS_SOCK, such as OVS_SOCKET_FILE.

@zhangzujian zhangzujian marked this pull request as ready for review May 6, 2023 06:44
@zhangzujian zhangzujian requested a review from oilbeater May 6, 2023 06:44
@zhangzujian zhangzujian merged commit 99be9cb into kubeovn:master May 6, 2023
@zhangzujian zhangzujian deleted the fix-underlay branch May 6, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need backport
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants