-
Notifications
You must be signed in to change notification settings - Fork 153
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
feat: support windows #248
Conversation
4e3a2c5
to
04aae1d
Compare
92c6a04
to
68afa63
Compare
6abcdf0
to
e3d37a9
Compare
5f843c8
to
8d07211
Compare
ce36f54
to
14d5302
Compare
8afe7db
to
bf69680
Compare
const ( | ||
IPv4 AddressFamily = "IPv4" | ||
IPv6 AddressFamily = "IPv6" | ||
Dual AddressFamily = "" |
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.
Default 为空,是否有歧义?
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.
Dual means both IPv4 and IPv6, any Powershell command which supports -AddressFamily
can accept an empty list(None
value) and treat it as [IPv4, IPv6]. The following doc explains more details: https://docs.microsoft.com/en-us/powershell/module/nettcpip/set-netipaddress?view=windowsserver2022-ps.
return nil | ||
} | ||
var ipv4Net = ip.FromIPNet(subnet) | ||
return (ipv4Net.IP + 2).ToIP() |
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.
will the result still in the subnet range?
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.
Yes or not, if the range is small enough, here will bit us. In a reasonable case, the default gateway of Pod HNSEndpoint is used for avoiding stuck in ARP response during outbound connectivity. Other CNI plugins give the same workaround in here, win-bridge, sdnbridge.
if ep != nil { | ||
// delete if the existing gateway endpoint is corrupted | ||
if IsHCNEndpointCorrupted(ep, i.ID, epAddr) { | ||
if _, err := deleteHCNEndpoint(ep, ""); err != nil { |
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.
重定义是否有问题? L167
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.
Corrupted validation is a fuse, that only be true
if the HNSNetwork type is changed or the target IP address is changed but the name still be the same. So we can just clean the stale endpoint and create again. On the other hand, if an HNSNetwork has been cleaned, those HNSEndpoints which are attaching will clean as well.
454ab26
to
2d0d49f
Compare
2d0d49f
to
d9749f9
Compare
FEATURE: Introducing Windows to the Terway family
TODO: