mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
feat(stack): detach git based stacks from git EE-2143 (#6307)
* feat(stack): detach git based stacks from git
This commit is contained in:
parent
125d84cbd1
commit
9ff8f42a66
6 changed files with 54 additions and 3 deletions
|
@ -49,7 +49,7 @@ func (payload *updateSwarmStackPayload) Validate(r *http.Request) error {
|
|||
|
||||
// @id StackUpdate
|
||||
// @summary Update a stack
|
||||
// @description Update a stack.
|
||||
// @description Update a stack, only for file based stacks.
|
||||
// @description **Access policy**: authenticated
|
||||
// @tags stacks
|
||||
// @security ApiKeyAuth
|
||||
|
@ -123,6 +123,15 @@ func (handler *Handler) stackUpdate(w http.ResponseWriter, r *http.Request) *htt
|
|||
}
|
||||
}
|
||||
|
||||
// Must not be git based stack. stop the auto update job if there is any
|
||||
if stack.AutoUpdate != nil {
|
||||
stopAutoupdate(stack.ID, stack.AutoUpdate.JobID, *handler.Scheduler)
|
||||
stack.AutoUpdate = nil
|
||||
}
|
||||
if stack.GitConfig != nil {
|
||||
stack.FromAppTemplate = true
|
||||
}
|
||||
|
||||
updateError := handler.updateAndDeployStack(r, stack, endpoint)
|
||||
if updateError != nil {
|
||||
return updateError
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue