mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
fix(api): remove automatic backend failure for Down endpoints (#3160)
This commit is contained in:
parent
a5e5983c28
commit
07505fabcc
2 changed files with 3 additions and 5 deletions
|
@ -25,10 +25,6 @@ func (handler *Handler) proxyRequestsToDockerAPI(w http.ResponseWriter, r *http.
|
||||||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find an endpoint with the specified identifier inside the database", err}
|
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to find an endpoint with the specified identifier inside the database", err}
|
||||||
}
|
}
|
||||||
|
|
||||||
if endpoint.Type != portainer.EdgeAgentEnvironment && endpoint.Status == portainer.EndpointStatusDown {
|
|
||||||
return &httperror.HandlerError{http.StatusServiceUnavailable, "Unable to query endpoint", errors.New("Endpoint is down")}
|
|
||||||
}
|
|
||||||
|
|
||||||
err = handler.requestBouncer.AuthorizedEndpointOperation(r, endpoint, true)
|
err = handler.requestBouncer.AuthorizedEndpointOperation(r, endpoint, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &httperror.HandlerError{http.StatusForbidden, "Permission denied to access endpoint", err}
|
return &httperror.HandlerError{http.StatusForbidden, "Permission denied to access endpoint", err}
|
||||||
|
|
|
@ -18,7 +18,8 @@ angular.module('portainer.app')
|
||||||
}
|
}
|
||||||
|
|
||||||
checkEndpointStatus(endpoint)
|
checkEndpointStatus(endpoint)
|
||||||
.then(function success() {
|
.then(function success(data) {
|
||||||
|
endpoint = data;
|
||||||
return switchToDockerEndpoint(endpoint);
|
return switchToDockerEndpoint(endpoint);
|
||||||
}).catch(function error(err) {
|
}).catch(function error(err) {
|
||||||
Notifications.error('Failure', err, 'Unable to verify endpoint status');
|
Notifications.error('Failure', err, 'Unable to verify endpoint status');
|
||||||
|
@ -59,6 +60,7 @@ angular.module('portainer.app')
|
||||||
|
|
||||||
EndpointService.updateEndpoint(endpoint.Id, { Status: status })
|
EndpointService.updateEndpoint(endpoint.Id, { Status: status })
|
||||||
.then(function success() {
|
.then(function success() {
|
||||||
|
endpoint.Status = status;
|
||||||
deferred.resolve(endpoint);
|
deferred.resolve(endpoint);
|
||||||
}).catch(function error(err) {
|
}).catch(function error(err) {
|
||||||
deferred.reject({ msg: 'Unable to update endpoint status', err: err });
|
deferred.reject({ msg: 'Unable to update endpoint status', err: err });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue