Merge pull request #108769 from SataQiu/fix-kubeadm-20220317

kubeadm: fix the bug that windows node failed to join IPv6 cluster due to preflight failures
This commit is contained in:
Kubernetes Prow Robot 2022-03-17 13:54:42 -07:00 committed by GitHub
commit 4d08582d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -933,7 +933,7 @@ func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfigura
// Check if Bridge-netfilter and IPv6 relevant flags are set // Check if Bridge-netfilter and IPv6 relevant flags are set
if ip := netutils.ParseIPSloppy(cfg.LocalAPIEndpoint.AdvertiseAddress); ip != nil { if ip := netutils.ParseIPSloppy(cfg.LocalAPIEndpoint.AdvertiseAddress); ip != nil {
if netutils.IsIPv6(ip) { if netutils.IsIPv6(ip) && runtime.GOOS == "linux" {
checks = append(checks, checks = append(checks,
FileContentCheck{Path: bridgenf6, Content: []byte{'1'}}, FileContentCheck{Path: bridgenf6, Content: []byte{'1'}},
FileContentCheck{Path: ipv6DefaultForwarding, Content: []byte{'1'}}, FileContentCheck{Path: ipv6DefaultForwarding, Content: []byte{'1'}},
@ -1003,7 +1003,7 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfigura
} }
} }
} }
if addIPv6Checks { if addIPv6Checks && runtime.GOOS == "linux" {
checks = append(checks, checks = append(checks,
FileContentCheck{Path: bridgenf6, Content: []byte{'1'}}, FileContentCheck{Path: bridgenf6, Content: []byte{'1'}},
FileContentCheck{Path: ipv6DefaultForwarding, Content: []byte{'1'}}, FileContentCheck{Path: ipv6DefaultForwarding, Content: []byte{'1'}},