-
Notifications
You must be signed in to change notification settings - Fork 288
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
Add Nutanix CCM ignore node IPs list #9072
Conversation
Hi @adiantum. Thanks for your PR. I'm waiting for a aws member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
- fix kube-vip validation - fix kube-vip add to ignore node list - add unit-test
/ok-to-test |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-0.21 #9072 +/- ##
===============================================
Coverage ? 72.39%
===============================================
Files ? 578
Lines ? 45541
Branches ? 0
===============================================
Hits ? 32968
Misses ? 10837
Partials ? 1736 ☔ View full report in Codecov by Sentry. |
pkg/providers/nutanix/template.go
Outdated
ip, ipNet, err := net.ParseCIDR(cidr) | ||
if err != nil { | ||
// log error and continue | ||
log.Printf("error parsing CIDR %s: %v", cidr, err) | ||
return result | ||
} |
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.
We are already validating this in the validator. Let's remove it from here.
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.
Fixed
pkg/providers/nutanix/template.go
Outdated
// Parse the range | ||
ipRange := strings.Split(ipRangeStr, "-") | ||
if len(ipRange) != 2 { | ||
// log error and return | ||
log.Printf("error parsing range %s: expected 2 values, got %d", ipRangeStr, len(ipRange)) | ||
return result | ||
} | ||
|
||
// Parse the start and end of the range | ||
start := net.ParseIP(strings.TrimSpace(ipRange[0])) | ||
end := net.ParseIP(strings.TrimSpace(ipRange[1])) | ||
if start == nil || end == nil { | ||
// log error and return | ||
log.Printf("error parsing range %s: invalid IP address", ipRangeStr) | ||
return result | ||
} | ||
|
||
cmp, err := compareIP(start, end) | ||
if err != nil { | ||
// log error and return | ||
log.Printf("error comparing IP addresses %s and %s: %v", start.String(), end.String(), err) | ||
return result | ||
} | ||
|
||
if cmp >= 0 { | ||
// swap start and end if start is greater than end | ||
start, end = end, start | ||
} |
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.
same as above, already validated in validator, can be removed
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.
Fixed
pkg/providers/nutanix/template.go
Outdated
ip := net.ParseIP(ipAddrStr) | ||
if ip == nil { | ||
// log error and return | ||
log.Printf("error parsing IP address %s", ipAddrStr) | ||
return result | ||
} |
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.
here as well, already validated, can be removed
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.
Fixed
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.
/lgtm
/approve
/woof
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavmpandey08 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description of changes:
Add kube-vip and optional list of ip addresses to CCM node ip addresses ignore list.
Required to fix bug with LB ip pool ranges and kube vip interception with node ip addresses.
Testing (if applicable):
Documentation added/planned (if applicable):
Description of 'ccmExcludeNodeIPs' field of NutanixDatacenterConfig spec will be added
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.