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

pull/4173/head
Anthony Lapenna 2020-08-07 14:08:57 +12:00 committed by GitHub
parent b8f8c75380
commit 747fdae269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

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
}