mirror of https://github.com/portainer/portainer
fix(stacks): fix an issue when deploying public stacks
parent
bca8936faa
commit
c267f8bf57
|
@ -83,14 +83,11 @@ function ($scope, $state, StackService, Authentication, Notifications, FormValid
|
||||||
$scope.state.actionInProgress = true;
|
$scope.state.actionInProgress = true;
|
||||||
createStack(name, method)
|
createStack(name, method)
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
Notifications.success('Stack successfully deployed');
|
return ResourceControlService.applyResourceControl('stack', name, userId, accessControlData, []);
|
||||||
return ResourceControlService.applyResourceControl('stack', name, userId, accessControlData, [])
|
|
||||||
.then(function success() {
|
|
||||||
$state.go('docker.stacks');
|
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.then(function success() {
|
||||||
Notifications.error('Failure', err, 'Unable to apply resource control on the stack');
|
Notifications.success('Stack successfully deployed');
|
||||||
});
|
$state.go('docker.stacks');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
Notifications.warning('Deployment error', err.err.data.err);
|
Notifications.warning('Deployment error', err.err.data.err);
|
||||||
|
|
|
@ -115,14 +115,11 @@ function ($scope, $q, $state, $transition$, $anchorScroll, $filter, ContainerSer
|
||||||
|
|
||||||
StackService.createStackFromGitRepository(stackName, repositoryOptions, template.Env)
|
StackService.createStackFromGitRepository(stackName, repositoryOptions, template.Env)
|
||||||
.then(function success(data) {
|
.then(function success(data) {
|
||||||
Notifications.success('Stack successfully deployed');
|
return ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, []);
|
||||||
ResourceControlService.applyResourceControl('stack', stackName, userId, accessControlData, [])
|
|
||||||
.then(function success() {
|
|
||||||
$state.go('docker.stacks');
|
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.then(function success() {
|
||||||
Notifications.error('Failure', err, 'Unable to apply resource control on the stack');
|
Notifications.success('Stack successfully deployed');
|
||||||
});
|
$state.go('docker.stacks');
|
||||||
})
|
})
|
||||||
.catch(function error(err) {
|
.catch(function error(err) {
|
||||||
Notifications.warning('Deployment error', err.err.data.err);
|
Notifications.warning('Deployment error', err.err.data.err);
|
||||||
|
|
Loading…
Reference in New Issue