use kube-apiserver proxy if no kubesphere api endpoint provided (#2144)

This commit is contained in:
zryfish
2020-06-01 19:54:05 +08:00
committed by GitHub
parent 345ce1ac0f
commit 59900f6e1c
5 changed files with 163 additions and 20 deletions

View File

@@ -236,6 +236,13 @@ func (h *handler) ValidateCluster(request *restful.Request, response *restful.Re
return
}
// kubesphere apiserver endpoint not provided, that's allowed
// Cluster dispatcher will use kube-apiserver proxy instead
if len(cluster.Spec.Connection.KubeSphereAPIEndpoint) == 0 {
response.WriteHeader(http.StatusOK)
return
}
_, err = validateKubeSphereAPIServer(cluster.Spec.Connection.KubeSphereAPIEndpoint)
if err != nil {
api.HandleBadRequest(response, request, fmt.Errorf("unable validate kubesphere endpoint, %v", err))