fix(stacks): fix stop and start [EE-5572] (#9050)
parent
2cd5d55b00
commit
2363d23de0
|
@ -16,8 +16,8 @@ function StackFactory($resource, API_ENDPOINT_STACKS) {
|
|||
remove: { method: 'DELETE', params: { id: '@id', external: '@external', endpointId: '@endpointId' } },
|
||||
getStackFile: { method: 'GET', params: { id: '@id', action: 'file' } },
|
||||
migrate: { method: 'POST', params: { id: '@id', action: 'migrate', endpointId: '@endpointId' }, ignoreLoadingBar: true },
|
||||
start: { method: 'POST', params: { id: '@id', action: 'start' } },
|
||||
stop: { method: 'POST', params: { id: '@id', action: 'stop' } },
|
||||
start: { method: 'POST', params: { id: '@id', action: 'start', endpointId: '@endpointId' } },
|
||||
stop: { method: 'POST', params: { id: '@id', action: 'stop', endpointId: '@endpointId' } },
|
||||
updateGit: { method: 'PUT', params: { id: '@id', action: 'git', subaction: 'redeploy' } },
|
||||
updateGitStackSettings: { method: 'POST', params: { id: '@id', action: 'git' }, ignoreLoadingBar: true },
|
||||
}
|
||||
|
|
|
@ -421,13 +421,13 @@ angular.module('portainer.app').factory('StackService', [
|
|||
};
|
||||
|
||||
service.start = start;
|
||||
function start(id) {
|
||||
return Stack.start({ id }).$promise;
|
||||
function start(endpointId, id) {
|
||||
return Stack.start({ id, endpointId }).$promise;
|
||||
}
|
||||
|
||||
service.stop = stop;
|
||||
function stop(id) {
|
||||
return Stack.stop({ id }).$promise;
|
||||
function stop(endpointId, id) {
|
||||
return Stack.stop({ endpointId, id }).$promise;
|
||||
}
|
||||
|
||||
function updateGit(id, endpointId, env, prune, gitConfig, pullImage) {
|
||||
|
|
|
@ -293,7 +293,7 @@ angular.module('portainer.app').controller('StackController', [
|
|||
|
||||
$scope.state.actionInProgress = true;
|
||||
try {
|
||||
await StackService.stop($scope.stack.Id);
|
||||
await StackService.stop(endpoint.Id, $scope.stack.Id);
|
||||
$state.reload();
|
||||
} catch (err) {
|
||||
Notifications.error('Failure', err, 'Unable to stop stack');
|
||||
|
@ -309,7 +309,7 @@ angular.module('portainer.app').controller('StackController', [
|
|||
$scope.state.actionInProgress = true;
|
||||
const id = $scope.stack.Id;
|
||||
try {
|
||||
await StackService.start(id);
|
||||
await StackService.start(endpoint.Id, id);
|
||||
$state.reload();
|
||||
} catch (err) {
|
||||
Notifications.error('Failure', err, 'Unable to start stack');
|
||||
|
|
Loading…
Reference in New Issue