fix(app/stacks): swarm stack duplicate and migrate errors [EE-5520] (#9039)

* fix(dev): dev container script

* fix(app/stacks): make swarm stack migrate effectively target the target env and not the current env

* fix(app/stacks): make stack duplicate save the target swarm id on duplicated swarm stack
pull/9051/head
LP B 1 year ago committed by GitHub
parent c7756f3018
commit 73950f3603
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,10 +7,10 @@ angular.module('portainer.docker').factory('SwarmService', [
'use strict';
var service = {};
service.swarm = function () {
service.swarm = function (endpointId) {
var deferred = $q.defer();
Swarm.get()
Swarm.get(endpointId ? { endpointId } : undefined)
.$promise.then(function success(data) {
var swarm = new SwarmViewModel(data);
deferred.resolve(swarm);

@ -50,7 +50,7 @@ angular.module('portainer.app').factory('StackService', [
service.migrateSwarmStack = function (stack, targetEndpointId, newName) {
var deferred = $q.defer();
SwarmService.swarm()
SwarmService.swarm(targetEndpointId)
.then(function success(data) {
var swarm = data;
if (swarm.Id === stack.SwarmId) {
@ -324,7 +324,7 @@ angular.module('portainer.app').factory('StackService', [
service.createSwarmStackFromFileContent = function (name, stackFileContent, env, endpointId) {
var deferred = $q.defer();
SwarmService.swarm()
SwarmService.swarm(endpointId)
.then(function success(swarm) {
var payload = {
Name: name,

@ -5,18 +5,17 @@ PORTAINER_DATA=${PORTAINER_DATA:-/tmp/portainer}
PORTAINER_PROJECT=${PORTAINER_PROJECT:-$(pwd)}
PORTAINER_FLAGS=${PORTAINER_FLAGS:-}
docker rm -f portainer > /dev/null
docker rm -f portainer
docker run -d \
-p 8000:8000 \
-p 9000:9000 \
-p 9443:9443 \
-v "$PORTAINER_PROJECT/dist:/app" \
-v "$PORTAINER_DATA:/data" \
-v /var/run/docker.sock:/var/run/docker.sock:z \
-v /var/run/docker.sock:/var/run/alternative.sock:z \
-v /tmp:/tmp \
--name portainer \
--rm \
portainer/base \
/app/portainer ${PORTAINER_FLAGS}
-p 8000:8000 \
-p 9000:9000 \
-p 9443:9443 \
-v "$PORTAINER_PROJECT/dist:/app" \
-v "$PORTAINER_DATA:/data" \
-v /var/run/docker.sock:/var/run/docker.sock:z \
-v /var/run/docker.sock:/var/run/alternative.sock:z \
-v /tmp:/tmp \
--name portainer \
portainer/base \
/app/portainer $PORTAINER_FLAGS

Loading…
Cancel
Save