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

replace port_group function call with ovnClient #2608

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

gugulee
Copy link
Contributor

@gugulee gugulee commented Apr 6, 2023

What type of this PR

Examples of user facing changes:

  • Features

Which issue(s) this PR fixes:

#2453

WHAT

🤖 Generated by Copilot at 74be2f5

This pull request refactors the port group management logic in various controllers, using the new ovnClient instead of the old ovnLegacyClient and the ovn-nbctl command line tool. This improves the performance, consistency, and simplicity of the network policy and security group operations.

🤖 Generated by Copilot at 74be2f5

Sing, O Muse, of the mighty ovnClient, the swift and skillful tool
That replaced the old and cumbersome ovnLegacyClient, the source of many a woe
And how the valiant coders, with wisdom and courage, refactored the port group code
To make it simpler, faster, and more consistent, like the arrows of Apollo

HOW

🤖 Generated by Copilot at 74be2f5

  • Replace the ovnLegacyClient with the ovnClient for port group operations, and pass externalIDs to the CreatePortGroup method to store metadata (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Simplify the logic to check and add ports to the port groups, and remove the unused functions to list and map the logical switch ports and port group ports (link, link, link, link)
  • Change the way to generate and use the port group names for network policies, using the np.Name field instead of the npName variable (link, link)
  • Initialize and populate a map to store the network policy and node port group names in gc.go, to avoid duplication and improve lookup efficiency (link, link, link)
  • Remove an empty line in node.go to improve code style (link)
  • Change the way to report the error messages, using a more concise and consistent format (link, link, link, link, link)

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

  • The commit message should be more descriptive and informative. It should clearly state what changes were made and why.
  • There are no potential bugs or format errors in the patch diff.
  • It is difficult to assess performance issues without further information about the code being modified.
  • Ways to improve could include adding comments to the code for clarity, refactoring repetitive code, or optimizing algorithms if applicable.

@zhangzujian zhangzujian added the performance Anything that can make Kube-OVN faster label Apr 7, 2023
@zhangzujian zhangzujian merged commit 1e8e382 into kubeovn:master Apr 7, 2023
@gugulee gugulee deleted the perf/libovsdb branch April 12, 2023 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Anything that can make Kube-OVN faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants