From 6c57e2fcedaa6086c0ffefc373e95e18c75593a3 Mon Sep 17 00:00:00 2001 From: SataQiu Date: Thu, 17 Mar 2022 22:07:08 +0800 Subject: [PATCH] kubeadm: fix the bug that windows node failed to join IPv6 cluster due to preflight failures Signed-off-by: SataQiu --- cmd/kubeadm/app/preflight/checks.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kubeadm/app/preflight/checks.go b/cmd/kubeadm/app/preflight/checks.go index 258453bfae6..422167319f7 100644 --- a/cmd/kubeadm/app/preflight/checks.go +++ b/cmd/kubeadm/app/preflight/checks.go @@ -933,7 +933,7 @@ func RunInitNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.InitConfigura // Check if Bridge-netfilter and IPv6 relevant flags are set if ip := netutils.ParseIPSloppy(cfg.LocalAPIEndpoint.AdvertiseAddress); ip != nil { - if netutils.IsIPv6(ip) { + if netutils.IsIPv6(ip) && runtime.GOOS == "linux" { checks = append(checks, FileContentCheck{Path: bridgenf6, 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, FileContentCheck{Path: bridgenf6, Content: []byte{'1'}}, FileContentCheck{Path: ipv6DefaultForwarding, Content: []byte{'1'}},