refactor(stack): stack build process backend only [EE-4342] (#7750)

This commit is contained in:
Oscar Zhou
2022-10-05 22:33:59 +13:00
committed by GitHub
parent 83a1ce9d2a
commit e9de484c3e
65 changed files with 2270 additions and 942 deletions

View File

@@ -6,7 +6,7 @@ import (
httperror "github.com/portainer/libhttp/error"
"github.com/portainer/libhttp/request"
"github.com/portainer/libhttp/response"
"github.com/portainer/portainer/api/stacks"
"github.com/portainer/portainer/api/stacks/deployments"
"github.com/gofrs/uuid"
"github.com/rs/zerolog/log"
@@ -38,8 +38,8 @@ func (handler *Handler) webhookInvoke(w http.ResponseWriter, r *http.Request) *h
return &httperror.HandlerError{StatusCode: statusCode, Message: "Unable to find the stack by webhook ID", Err: err}
}
if err = stacks.RedeployWhenChanged(stack.ID, handler.StackDeployer, handler.DataStore, handler.GitService); err != nil {
if _, ok := err.(*stacks.StackAuthorMissingErr); ok {
if err = deployments.RedeployWhenChanged(stack.ID, handler.StackDeployer, handler.DataStore, handler.GitService); err != nil {
if _, ok := err.(*deployments.StackAuthorMissingErr); ok {
return &httperror.HandlerError{StatusCode: http.StatusConflict, Message: "Autoupdate for the stack isn't available", Err: err}
}