fix proxy bug (#2002)

This commit is contained in:
zryfish
2020-04-11 21:05:40 +08:00
committed by GitHub
parent 6b4fd9b8fa
commit c3c6ed8898
10 changed files with 123 additions and 22 deletions

View File

@@ -74,7 +74,7 @@ func (c *clusterDispatch) Dispatch(w http.ResponseWriter, req *http.Request, han
}
u := *req.URL
u.Host = fmt.Sprintf("%s:%d", agent.Spec.Proxy, agent.Spec.KubeSphereAPIServerPort)
u.Host = agent.Spec.Proxy
u.Path = strings.Replace(u.Path, fmt.Sprintf("/clusters/%s", info.Cluster), "", 1)
httpProxy := proxy.NewUpgradeAwareHandler(&u, http.DefaultTransport, true, false, c)