Skip to content
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

Merged
merged 6 commits into from
Mar 1, 2022
Merged

Conversation

thxCode
Copy link
Contributor

@thxCode thxCode commented Jul 29, 2021

FEATURE: Introducing Windows to the Terway family

TODO:

  • Split the Linux belongings
  • Introduce Windows
    • VPC mode
    • ENI mode
    • ENIIP mode
  • CI flow for Windows: build / package
  • Test cases for system call apis
  • Document & Examples

@thxCode thxCode force-pushed the feat/windows branch 26 times, most recently from 4e3a2c5 to 04aae1d Compare August 3, 2021 15:16
@thxCode thxCode changed the title [WIP] feat: support windows vpcip [WIP] feat: support windows Aug 3, 2021
@thxCode thxCode force-pushed the feat/windows branch 2 times, most recently from 92c6a04 to 68afa63 Compare November 17, 2021 13:58
@thxCode thxCode force-pushed the feat/windows branch 4 times, most recently from 5f843c8 to 8d07211 Compare January 11, 2022 09:32
@thxCode thxCode force-pushed the feat/windows branch 3 times, most recently from ce36f54 to 14d5302 Compare January 29, 2022 07:54
@thxCode thxCode force-pushed the feat/windows branch 6 times, most recently from 8afe7db to bf69680 Compare February 9, 2022 06:06
@l1b0k l1b0k requested review from BSWANG and l1b0k February 9, 2022 07:55
@thxCode thxCode changed the title [WIP] feat: support windows feat: support windows Feb 12, 2022
@thxCode thxCode marked this pull request as ready for review February 12, 2022 03:21
const (
IPv4 AddressFamily = "IPv4"
IPv6 AddressFamily = "IPv6"
Dual AddressFamily = ""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default 为空,是否有歧义?

Copy link
Contributor Author

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.

image

return nil
}
var ipv4Net = ip.FromIPNet(subnet)
return (ipv4Net.IP + 2).ToIP()
Copy link
Collaborator

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?

Copy link
Contributor Author

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重定义是否有问题? L167

Copy link
Contributor Author

@thxCode thxCode Feb 15, 2022

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.

@thxCode thxCode force-pushed the feat/windows branch 2 times, most recently from 454ab26 to 2d0d49f Compare February 15, 2022 03:23
@l1b0k l1b0k merged commit 6abe77d into AliyunContainerService:main Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants