fix(agent/console): fix an issue with the agent console on Docker environments (#4169)

This commit is contained in:
Anthony Lapenna
2020-08-07 14:08:57 +12:00
committed by GitHub
parent b8f8c75380
commit 747fdae269

View File

@@ -33,9 +33,12 @@ func (handler *Handler) proxyEdgeAgentWebsocketRequest(w http.ResponseWriter, r
}
func (handler *Handler) proxyAgentWebsocketRequest(w http.ResponseWriter, r *http.Request, params *webSocketRequestParams) error {
// TODO: k8s merge - make sure this is still working with Docker agent
//agentURL, err := url.Parse(params.endpoint.URL)
agentURL, err := url.Parse(fmt.Sprintf("http://%s", params.endpoint.URL))
endpointURL := params.endpoint.URL
if params.endpoint.Type == portainer.AgentOnKubernetesEnvironment {
endpointURL = fmt.Sprintf("http://%s", params.endpoint.URL)
}
agentURL, err := url.Parse(endpointURL)
if err != nil {
return err
}