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

Merge pull request #59054 from bart0sh/PR0003-proxy-port

Automatic merge from submit-queue. 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>. Remove port from HTTPProxyCheck **What this PR does / why we need it**: HTTPProxyCheck doesn't use port. It uses proxy related variables (HTTP_PROXY, NO_PROXY, etc) that only operate with protocol and host. Removing port from the check should make it more clear for user that port is not used as it will not be present in the check output. **Release note**: ```release-note NONE ```
parents c3a92d0b c6c82351
...@@ -415,7 +415,6 @@ func (hc HostnameCheck) Check() (warnings, errors []error) { ...@@ -415,7 +415,6 @@ func (hc HostnameCheck) Check() (warnings, errors []error) {
type HTTPProxyCheck struct { type HTTPProxyCheck struct {
Proto string Proto string
Host string Host string
Port int
} }
// Name returns HTTPProxy as name for HTTPProxyCheck // Name returns HTTPProxy as name for HTTPProxyCheck
...@@ -426,7 +425,7 @@ func (hst HTTPProxyCheck) Name() string { ...@@ -426,7 +425,7 @@ func (hst HTTPProxyCheck) Name() string {
// Check validates http connectivity type, direct or via proxy. // Check validates http connectivity type, direct or via proxy.
func (hst HTTPProxyCheck) Check() (warnings, errors []error) { func (hst HTTPProxyCheck) Check() (warnings, errors []error) {
url := fmt.Sprintf("%s://%s:%d", hst.Proto, hst.Host, hst.Port) url := fmt.Sprintf("%s://%s", hst.Proto, hst.Host)
req, err := http.NewRequest("GET", url, nil) req, err := http.NewRequest("GET", url, nil)
if err != nil { if err != nil {
...@@ -901,7 +900,7 @@ func RunInitMasterChecks(execer utilsexec.Interface, cfg *kubeadmapi.MasterConfi ...@@ -901,7 +900,7 @@ func RunInitMasterChecks(execer utilsexec.Interface, cfg *kubeadmapi.MasterConfi
ControllerManagerExtraArgs: cfg.ControllerManagerExtraArgs, ControllerManagerExtraArgs: cfg.ControllerManagerExtraArgs,
SchedulerExtraArgs: cfg.SchedulerExtraArgs, SchedulerExtraArgs: cfg.SchedulerExtraArgs,
}, },
HTTPProxyCheck{Proto: "https", Host: cfg.API.AdvertiseAddress, Port: int(cfg.API.BindPort)}, HTTPProxyCheck{Proto: "https", Host: cfg.API.AdvertiseAddress},
HTTPProxyCIDRCheck{Proto: "https", CIDR: cfg.Networking.ServiceSubnet}, HTTPProxyCIDRCheck{Proto: "https", CIDR: cfg.Networking.ServiceSubnet},
HTTPProxyCIDRCheck{Proto: "https", CIDR: cfg.Networking.PodSubnet}, HTTPProxyCIDRCheck{Proto: "https", CIDR: cfg.Networking.PodSubnet},
} }
......
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