Merge pull request #23903 from zhouhaibing089/https-fix

Automatic merge from submit-queue

the component status health check should check whether the scheme of backend storage url is https or not

fix https://github.com/kubernetes/kubernetes/issues/23897, when querying the component status of etcd (backend storage), the scheme of url is not checked and use `http` always, this commit aims to fix this.
This commit is contained in:
k8s-merge-robot 2016-04-16 20:22:57 -07:00
commit d44457ebaf

View File

@ -517,7 +517,13 @@ func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server {
port = 4001
}
// TODO: etcd health checking should be abstracted in the storage tier
serversToValidate[fmt.Sprintf("etcd-%d", ix)] = apiserver.Server{Addr: addr, Port: port, Path: "/health", Validate: etcdutil.EtcdHealthCheck}
serversToValidate[fmt.Sprintf("etcd-%d", ix)] = apiserver.Server{
Addr: addr,
EnableHTTPS: etcdUrl.Scheme == "https",
Port: port,
Path: "/health",
Validate: etcdutil.EtcdHealthCheck,
}
}
return serversToValidate
}