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

refactor: Improving query performance of iptablesEips using caching #2713

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

shane965
Copy link
Contributor

@shane965 shane965 commented Apr 25, 2023

What type of this PR

Examples of user facing changes:

  • Features

Which issue(s) this PR fixes:

Fixes #(issue-number)

WHAT

🤖 Generated by Copilot at 5e4a6ba

Refactor controller package to improve performance, readability, and consistency. Use iptables eips lister and label selectors for QoS policy management. Simplify and fix iptables rule generation for vpc eip updates.

🤖 Generated by Copilot at 5e4a6ba

Sing, O Muse, of the mighty refactorings
That the skilled coders wrought on the controller
To enhance its performance and its beauty
With iptables and label selectors.

HOW

🤖 Generated by Copilot at 5e4a6ba

  • Replace the fields package with the labels package and use the iptables eips lister instead of the kubeovn client for better performance and consistency in the controller package (link, link)
  • Update the handleUpdateQoSPolicy function in qos_policy.go to use the iptables eips lister with label selectors and assign the eip variable directly from the eips slice (link, link)
  • Update the calcDualSubnetStatusIP and calcSubnetStatusIP functions in subnet.go to use the iptables eips lister with label selectors (link, link)
  • Update the handleUpdateVpcEip function in vpc_nat_gateway.go to use the iptables eips lister with label selectors and assign the eip variable directly from the eips slice (link, link)
  • Update the addEipQoS and deleteEipQoS functions in vpc_nat_gw_eip.go to use the iptables eips lister with label selectors and check the QoS policy sharing status (link)

@github-actions
Copy link
Contributor

  • The commit message should be more descriptive and informative.
  • In qos_policy.go, the import statement for fields is not used anymore, it should be removed.
  • In qos_policy.go, the usage of c.config.KubeOvnClient.KubeovnV1().IptablesEIPs().List() can be replaced with c.iptablesEipsLister.List().
  • In subnet.go and vpc_nat_gateway.go, the usage of c.config.KubeOvnClient.KubeovnV1().IptablesEIPs().List() can be replaced with c.iptablesEipsLister.List().
  • In vpc_nat_gw_eip.go, the import statement for fields is not used anymore, it should be removed.
  • In vpc_nat_gw_eip.go, the usage of c.config.KubeOvnClient.KubeovnV1().IptablesEIPs().List() can be replaced with c.iptablesEipsLister.List().
  • In qos_policy.go, eips.Items can be replaced with eips.
  • In subnet.go and vpc_nat_gateway.go, eips.Items can be replaced with eips.
  • In vpc_nat_gw_eip.go, eips.Items can be replaced with eips.

@zbb88888 zbb88888 merged commit a6d2a53 into kubeovn:master Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants