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'}},