Commit 3ecc49da authored by Ed Bartosh's avatar Ed Bartosh

Add HTTPProxyCheck for API servers

It makes sense to check all API servers mentioned in the command line and print warnings if they're going to be accessed through proxy. This is similar to what's already done for 'kubeadm init'.
parent aee2cff1
...@@ -999,19 +999,27 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.NodeConfigura ...@@ -999,19 +999,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 {
if ip.To4() == nil && ip.To16() != nil {
checks = append(checks, checks = append(checks,
FileContentCheck{Path: bridgenf6, Content: []byte{'1'}}, HTTPProxyCheck{Proto: "https", Host: ipstr},
) )
break // Ensure that check is added only once if bridgenf6Check == nil {
if ip := net.ParseIP(ipstr); ip != nil {
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