mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +02:00
feat(api/stacks): use compose-unpacker to deploy stacks from git [EE-4758] (#8725)
* feat(api/stacks): use compose-unpacker to deploy stacks from git * refactor(api/stacks): move stack operation as unpacker builder parameter + check builder func existence * fix(api/stacks): defer removal of unpacker container after error check * refactor(api/unpacker-builder): clearer code around client creation for standalone and swarm manager * refactor(api/stacks): extract git stack check to utility function * fix(api/stacks): apply skip tls when deploying with unpcker - ref EE-5023 * fix(api/stacks): defer close of docker client
This commit is contained in:
parent
dc5f866a24
commit
5a04338087
14 changed files with 601 additions and 12 deletions
|
@ -117,8 +117,14 @@ func (handler *Handler) stackStop(w http.ResponseWriter, r *http.Request) *httpe
|
|||
func (handler *Handler) stopStack(stack *portainer.Stack, endpoint *portainer.Endpoint) error {
|
||||
switch stack.Type {
|
||||
case portainer.DockerComposeStack:
|
||||
if stackutils.IsGitStack(stack) {
|
||||
return handler.StackDeployer.StopRemoteComposeStack(stack, endpoint)
|
||||
}
|
||||
return handler.ComposeStackManager.Down(context.TODO(), stack, endpoint)
|
||||
case portainer.DockerSwarmStack:
|
||||
if stackutils.IsGitStack(stack) {
|
||||
return handler.StackDeployer.StopRemoteSwarmStack(stack, endpoint)
|
||||
}
|
||||
return handler.SwarmStackManager.Remove(stack, endpoint)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue