Unverified Commit f7e57573 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #58812 from bart0sh/PR0001-join-checks

Automatic merge from submit-queue (batch tested with PRs 59653, 58812, 59582, 59665, 59511). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Add HTTPProxyCheck to preflight checks for 'kubeadm join' subcommand **What this PR does / why we need it:** Add HTTPProxyCheck for API servers It makes sense to check API servers and print warnings if they're going to be accessed through proxy. This is similar to what's already done for 'kubeadm init'.
parents 1e8f40f4 3ecc49da
...@@ -1000,19 +1000,27 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.NodeConfigura ...@@ -1000,19 +1000,27 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.NodeConfigura
criCtlChecker) criCtlChecker)
} }
var bridgenf6Check Checker
for _, server := range cfg.DiscoveryTokenAPIServers { for _, server := range cfg.DiscoveryTokenAPIServers {
ipstr, _, err := net.SplitHostPort(server) ipstr, _, err := net.SplitHostPort(server)
if err == nil { if err == nil {
if ip := net.ParseIP(ipstr); ip != nil { checks = append(checks,
if ip.To4() == nil && ip.To16() != nil { HTTPProxyCheck{Proto: "https", Host: ipstr},
checks = append(checks, )
FileContentCheck{Path: bridgenf6, Content: []byte{'1'}}, if bridgenf6Check == nil {
) if ip := net.ParseIP(ipstr); ip != nil {
break // Ensure that check is added only once if ip.To4() == nil && ip.To16() != nil {
// This check should be added only once
bridgenf6Check = FileContentCheck{Path: bridgenf6, Content: []byte{'1'}}
}
} }
} }
} }
} }
if bridgenf6Check != nil {
checks = append(checks, bridgenf6Check)
}
return RunChecks(checks, os.Stderr, ignorePreflightErrors) return RunChecks(checks, os.Stderr, ignorePreflightErrors)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment