refactor(stack): change stack creation flow to save stack first [BE-12650] (#1959)

This commit is contained in:
Oscar Zhou
2026-02-27 10:14:17 +13:00
committed by GitHub
parent 56a840e207
commit 5869a8948d
15 changed files with 127 additions and 60 deletions
@@ -6,7 +6,6 @@ import (
"github.com/portainer/portainer/api/http/security"
"github.com/portainer/portainer/api/scheduler"
"github.com/portainer/portainer/api/stacks/deployments"
httperror "github.com/portainer/portainer/pkg/libhttp/error"
)
type ComposeStackGitBuilder struct {
@@ -61,7 +60,7 @@ func (b *ComposeStackGitBuilder) Deploy(payload *StackPayload, endpoint *portain
composeDeploymentConfig, err := deployments.CreateComposeStackDeploymentConfig(b.SecurityContext, b.stack, endpoint, b.dataStore, b.fileService, b.stackDeployer, false, false)
if err != nil {
b.err = httperror.InternalServerError(err.Error(), err)
b.err = err
return b
}