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

fix: apply changes to the latest version #3514

Merged
merged 1 commit into from
Dec 19, 2023
Merged

Conversation

zcq98
Copy link
Member

@zcq98 zcq98 commented Dec 12, 2023

Pull Request

What type of this PR

Examples of user facing changes:

  • Bug fixes

c.config.KubeOvnClient.KubeovnV1().Subnets().Update should be applied on the latest subnet, func formatSubnet should return the latest version subnet(same problem to vlan and vpc update)

Which issue(s) this PR fixes

WHAT

🤖[deprecated] Generated by Copilot at 4f0444f

Refactor and optimize some functions related to subnet, vlan, vpc, and vip initialization and status update in pkg/controller. Reduce unnecessary deep copies and controller arguments, and make the functions return updated objects. Use the Update method instead of the deprecated PatchSync method in the e2e test.

🤖[deprecated] Generated by Copilot at 4f0444f

Oh we're the coders of the Controller struct
And we make it better with every pull request
We refactor and update with skill and with zest
Heave away, me hearties, heave away

HOW

🤖[deprecated] Generated by Copilot at 4f0444f

  • Change formatSubnet, calcDualSubnetStatusIP, and calcSubnetStatusIP functions to methods of the Controller struct and remove the c parameter (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link). This makes the code more consistent and concise, and avoids passing the controller as an argument to every function that needs it.

pkg/controller/init.go Outdated Show resolved Hide resolved
pkg/controller/subnet.go Outdated Show resolved Hide resolved
pkg/controller/subnet.go Outdated Show resolved Hide resolved
pkg/controller/vpc.go Outdated Show resolved Hide resolved
pkg/controller/subnet.go Outdated Show resolved Hide resolved
pkg/controller/subnet.go Show resolved Hide resolved
pkg/controller/subnet.go Outdated Show resolved Hide resolved
pkg/controller/subnet.go Show resolved Hide resolved
pkg/controller/subnet.go Show resolved Hide resolved
pkg/controller/vip.go Show resolved Hide resolved
@zhangzujian zhangzujian added bug Something isn't working need backport labels Dec 12, 2023
@zcq98 zcq98 marked this pull request as ready for review December 12, 2023 10:01
@bobz965
Copy link
Collaborator

bobz965 commented Dec 18, 2023

hi @oilbeater could you help review this? thanks

pkg/controller/subnet.go Show resolved Hide resolved
@oilbeater oilbeater merged commit 65cf9ce into kubeovn:master Dec 19, 2023
56 of 59 checks passed
@oilbeater
Copy link
Collaborator

Nice catch! @zcq98

bobz965 pushed a commit that referenced this pull request Dec 19, 2023
@zcq98 zcq98 deleted the update-fix branch December 20, 2023 03:05
oilbeater pushed a commit that referenced this pull request Dec 20, 2023
Signed-off-by: zcq98 <[email protected]>
Co-authored-by: zcq98 <[email protected]>
Signed-off-by: oilbeater <[email protected]>
@zhangzujian zhangzujian mentioned this pull request Mar 26, 2024
1 task
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.

4 participants