From 2de4863532f801ee193f6614f9e1c888868f1e58 Mon Sep 17 00:00:00 2001 From: cmeng Date: Mon, 7 Aug 2023 10:33:04 +1200 Subject: [PATCH] fix(edge-stack): detaching swarm stack from git repository EE-5812 (#9998) --- api/http/handler/stacks/stack_update.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/http/handler/stacks/stack_update.go b/api/http/handler/stacks/stack_update.go index 05c0c9150..9211d86e4 100644 --- a/api/http/handler/stacks/stack_update.go +++ b/api/http/handler/stacks/stack_update.go @@ -268,6 +268,11 @@ func (handler *Handler) updateSwarmStack(r *http.Request, stack *portainer.Stack stack.Env = payload.Env + if stack.GitConfig != nil { + // detach from git + stack.GitConfig = nil + } + stackFolder := strconv.Itoa(int(stack.ID)) _, err = handler.FileService.UpdateStoreStackFileFromBytes(stackFolder, stack.EntryPoint, []byte(payload.StackFileContent)) if err != nil {