1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-02 20:35:25 +02:00

feat(stacks): support standalone stacks on ARM (#5310)

This commit is contained in:
Chaim Lev-Ari 2021-09-06 10:58:26 +03:00 committed by GitHub
parent 582d370172
commit 3453735c8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 181 additions and 308 deletions

View file

@ -1,6 +1,7 @@
package stacks
import (
"context"
"fmt"
"net/http"
"path"
@ -409,7 +410,7 @@ func (handler *Handler) deployComposeStack(config *composeStackDeploymentConfig)
handler.SwarmStackManager.Login(config.registries, config.endpoint)
err = handler.ComposeStackManager.Up(config.stack, config.endpoint)
err = handler.ComposeStackManager.Up(context.TODO(), config.stack, config.endpoint)
if err != nil {
return errors.Wrap(err, "failed to start up the stack")
}

View file

@ -1,6 +1,7 @@
package stacks
import (
"context"
"errors"
"net/http"
"strconv"
@ -174,5 +175,5 @@ func (handler *Handler) deleteStack(stack *portainer.Stack, endpoint *portainer.
return handler.SwarmStackManager.Remove(stack, endpoint)
}
return handler.ComposeStackManager.Down(stack, endpoint)
return handler.ComposeStackManager.Down(context.TODO(), stack, endpoint)
}

View file

@ -1,6 +1,7 @@
package stacks
import (
"context"
"errors"
"fmt"
"net/http"
@ -118,7 +119,7 @@ func (handler *Handler) stackStart(w http.ResponseWriter, r *http.Request) *http
func (handler *Handler) startStack(stack *portainer.Stack, endpoint *portainer.Endpoint) error {
switch stack.Type {
case portainer.DockerComposeStack:
return handler.ComposeStackManager.Up(stack, endpoint)
return handler.ComposeStackManager.Up(context.TODO(), stack, endpoint)
case portainer.DockerSwarmStack:
return handler.SwarmStackManager.Deploy(stack, true, endpoint)
}

View file

@ -1,6 +1,7 @@
package stacks
import (
"context"
"errors"
"net/http"
@ -102,7 +103,7 @@ 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:
return handler.ComposeStackManager.Down(stack, endpoint)
return handler.ComposeStackManager.Down(context.TODO(), stack, endpoint)
case portainer.DockerSwarmStack:
return handler.SwarmStackManager.Remove(stack, endpoint)
}