fix(stacks): fix stop and start [EE-5572] (#9050)

pull/9115/head
Chaim Lev-Ari 2023-06-22 21:08:24 +07:00 committed by GitHub
parent 2cd5d55b00
commit 2363d23de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -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 },
}

View File

@ -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) {

View File

@ -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');