keep vm vip when enableKeepVmIP is true #3053
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes:
Fixes #2954
WHAT
🤖 Generated by Copilot at 94621b0
This pull request adds a feature to reuse IP addresses for virtual machine pods and refactors the
podReuseVip
function. It changes the logic and location of the function inpkg/controller/vip.go
and updates the function call inpkg/controller/pod.go
.🤖 Generated by Copilot at 94621b0
HOW
🤖 Generated by Copilot at 94621b0
isVMPod
inacquireAddress
inpkg/controller/pod.go
to indicate whether the pod is a virtual machine pod or not (link)c.config.EnableKeepVmIP
flag and set theisVMPod
variable accordingly inacquireAddress
inpkg/controller/pod.go
(link)isVMPod
variable as an argument to thepodReuseVip
function, which is moved frompkg/controller/vip.go
topkg/controller/pod.go
(link, link)isStsPod
tokeepVIP
in thepodReuseVip
function to reflect the more general purpose of reusing the VIP for pods that need to keep the same IP address (link)isStsPod
variable with thekeepVIP
variable in the condition of thepodReuseVip
function (link)