-
Notifications
You must be signed in to change notification settings - Fork 275
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
Check if the kube-proxy VIP was already reserved #5705
Conversation
8b30525
to
5022188
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits
pkg/windows/flannel.go
Outdated
if err != nil { | ||
return "", fmt.Errorf("failed to create host-local store: %w", err) | ||
} | ||
ips := hostlocalStore.GetByID("kube-proxy", "source-vip") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ips := hostlocalStore.GetByID("kube-proxy", "source-vip") | |
ips := hostlocalStore.GetByID(HostlocalContainerID, HostlocalInterfaceName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm dumb. Thanks Brad
pkg/windows/flannel.go
Outdated
FlannelConfigName = "07-flannel.conflist" | ||
FlannelKubeConfigName = "flannel.kubeconfig" | ||
FlanneldConfigName = "flanneld-net-conf.json" | ||
FlannelChart = "rke2-flannel" | ||
HostlocalContainerID = "kube-proxy" | ||
HostlocalInterfaceName = "source-vip" | ||
HostLocalDataDir = "/var/lib/cni/networks" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do any of these actually need to be exported? I don't see that they are used outside this package. If not, don't export them.
FlannelConfigName = "07-flannel.conflist" | |
FlannelKubeConfigName = "flannel.kubeconfig" | |
FlanneldConfigName = "flanneld-net-conf.json" | |
FlannelChart = "rke2-flannel" | |
HostlocalContainerID = "kube-proxy" | |
HostlocalInterfaceName = "source-vip" | |
HostLocalDataDir = "/var/lib/cni/networks" | |
flannelConfigName = "07-flannel.conflist" | |
flannelKubeConfigName = "flannel.kubeconfig" | |
flanneldConfigName = "flanneld-net-conf.json" | |
flannelChart = "rke2-flannel" | |
hostlocalContainerID = "kube-proxy" | |
hostlocalInterfaceName = "source-vip" | |
hostLocalDataDir = "/var/lib/cni/networks" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I thought constants start always with a capital letter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlannelChart
is the only one used by another package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything uppercase (const, var, or func) is exported. Anything lowercase is package local.
5022188
to
a03ab12
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5705 +/- ##
===========================================
+ Coverage 9.49% 26.04% +16.55%
===========================================
Files 30 30
Lines 2634 2634
===========================================
+ Hits 250 686 +436
+ Misses 2362 1903 -459
- Partials 22 45 +23
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Manuel Buil <[email protected]>
a03ab12
to
74b9ada
Compare
Proposed Changes
This PR adds a check before reserving the IP for kube-proxy. It checks if that reservation was already made and it that case, uses that IP.
Types of Changes
Bugfix
Verification
Issue explains how to verify
Testing
Linked Issues
#5704
User-Facing Change
Further Comments