From 0cd272211a5703316c185ecd5f08b713b9eb178e Mon Sep 17 00:00:00 2001 From: matias-portainer <104775949+matias-portainer@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:21:13 -0300 Subject: [PATCH] fix(edgejobs): fix edge jobs log collection EE-4893 (#8328) --- api/http/handler/edgejobs/edgejob_tasklogs_collect.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/http/handler/edgejobs/edgejob_tasklogs_collect.go b/api/http/handler/edgejobs/edgejob_tasklogs_collect.go index e2281a933..e2b1cb326 100644 --- a/api/http/handler/edgejobs/edgejob_tasklogs_collect.go +++ b/api/http/handler/edgejobs/edgejob_tasklogs_collect.go @@ -66,5 +66,16 @@ func (handler *Handler) edgeJobTasksCollect(w http.ResponseWriter, r *http.Reque return httperror.InternalServerError("Unable to persist Edge job changes in the database", err) } + endpoint, err := handler.DataStore.Endpoint().Endpoint(endpointID) + if err != nil { + return httperror.InternalServerError("Unable to retrieve environment from the database", err) + } + + if endpoint.Edge.AsyncMode { + return httperror.BadRequest("Async Edge Endpoints are not supported in Portainer CE", nil) + } + + handler.ReverseTunnelService.AddEdgeJob(endpointID, edgeJob) + return response.Empty(w) }