-
Notifications
You must be signed in to change notification settings - Fork 244
fix: skip reserved IPs #2060
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: skip reserved IPs #2060
Conversation
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.
no objection as a quick fix for Windows but think we should only reserve the subnet's 0th address and broadcast instead of the .0 and .255 out of every /24 within the subnet
cns/kubecontroller/nodenetworkconfig/conversion_windows_test.go
Outdated
Show resolved
Hide resolved
af70959
to
ce76762
Compare
ce76762
to
778bace
Compare
// as secondary IPs | ||
startingAddr := primaryIPPrefix.Masked().Addr() // the masked address is the 0th IP in the subnet | ||
// the masked address is the 0th IP in the subnet and startingAddr is the 2nd IP (*.1) | ||
startingAddr := primaryIPPrefix.Masked().Addr().Next() |
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 also need to reserve .255
}, | ||
} | ||
|
||
var validVNETBlockRequest = &cns.CreateNetworkContainerRequest{ |
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.
can you please also add a test case for ipv6?
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'll add later since this needs to go in for quick-fix
@@ -35,3 +35,63 @@ var validOverlayRequest = &cns.CreateNetworkContainerRequest{ | |||
}, | |||
}, | |||
} | |||
|
|||
var validVNETBlockRequest = &cns.CreateNetworkContainerRequest{ |
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.
Can you inline these vars in the body of the tests that use them or turn them into factory funcs?
Despite their prevalence in ACN code, using package variables for test data is not a best practice.
Co-authored-by: Jaeryn <[email protected]>
Co-authored-by: Jaeryn <[email protected]>
Reason for Change:
We need to use .1 address of subnet as GW; skipping 0th and last IP of subnets since they are reserved from HNS POV
Issue Fixed:
Requirements:
Notes: