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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: wrong usage about DeepEqual #3396

Merged
merged 1 commit into from
Nov 10, 2023
Merged

fix: wrong usage about DeepEqual #3396

merged 1 commit into from
Nov 10, 2023

Conversation

bobz965
Copy link
Collaborator

@bobz965 bobz965 commented Nov 9, 2023

Pull Request

What type of this PR

Examples of user facing changes:

  • Bug fixes

Which issue(s) this PR fixes

Fixes #(issue-number)

WHAT

馃 Generated by Copilot at 8c187db

This pull request improves the performance and readability of the code that handles external gateway nodes, OvnEip, OvnFip, and Vpc resources in the pkg/controller package. It removes unnecessary dependencies on the reflect package and simplifies object comparison logic.

馃 Generated by Copilot at 8c187db

This pull request has some changes
To improve how the code manages
Vpc, OvnEip, and OvnFip
And external gateway nodes that slip
By using less reflect and more ranges

HOW

馃 Generated by Copilot at 8c187db

  • Simplify the comparison of old and new objects in the enqueueUpdateOvnEip, enqueueUpdateOvnFip, and enqueueUpdateVpc functions by using direct equality checks instead of reflect.DeepEqual calls for simple string and boolean fields. This improves the performance and readability of the code. (link, link, link)
  • Remove the unused reflect package import from the ovn_eip.go and ovn_fip.go files, following the best practice of removing unnecessary dependencies. (link, link)
  • Refactor the logic in the getGatewayChassis function in external_gw.go to use a loop to trim and append the node names from the external-gw-nodes config, instead of using a single strings.Split call. This avoids potential issues with empty or extra spaces in the node names, and makes the code more consistent with other similar functions. (link)

Signed-off-by: bobz965 <zhangbingbing2_yewu@cmss.chinamobile.com>
@bobz965 bobz965 merged commit 7778560 into kubeovn:master Nov 10, 2023
60 checks passed
@bobz965 bobz965 deleted the fix branch November 10, 2023 01:49
bobz965 added a commit that referenced this pull request Nov 10, 2023
Signed-off-by: bobz965 <zhangbingbing2_yewu@cmss.chinamobile.com>
bobz965 added a commit that referenced this pull request Nov 10, 2023
Signed-off-by: bobz965 <zhangbingbing2_yewu@cmss.chinamobile.com>
zcq98 pushed a commit to zcq98/kube-ovn that referenced this pull request Nov 10, 2023
Signed-off-by: bobz965 <zhangbingbing2_yewu@cmss.chinamobile.com>
bobz965 added a commit to bobz965/kube-ovn that referenced this pull request Nov 15, 2023
Signed-off-by: bobz965 <zhangbingbing2_yewu@cmss.chinamobile.com>
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.

None yet

2 participants