fix(stack): stack prune service does not persist [BE-12314] (#1323)

This commit is contained in:
Oscar Zhou
2025-11-03 12:22:04 +13:00
committed by GitHub
parent b70321a0aa
commit ae53de42df
2 changed files with 9 additions and 1 deletions

View File

@@ -309,6 +309,14 @@ func (handler *Handler) updateSwarmStack(tx dataservices.DataStoreTx, r *http.Re
return httperror.InternalServerError(err.Error(), err)
}
if stack.Option != nil {
stack.Option.Prune = payload.Prune
} else {
stack.Option = &portainer.StackOption{
Prune: payload.Prune,
}
}
// Deploy the stack
if err := swarmDeploymentConfig.Deploy(); err != nil {
if rollbackErr := handler.FileService.RollbackStackFile(stackFolder, stack.EntryPoint); rollbackErr != nil {