mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
fix(container-creation): ignore error when pulling an image (#914)
This commit is contained in:
parent
1c4ccfe294
commit
d5f00597a5
1 changed files with 17 additions and 17 deletions
|
@ -299,24 +299,24 @@ function ($q, $scope, $state, $stateParams, $filter, Info, Container, ContainerH
|
||||||
};
|
};
|
||||||
|
|
||||||
function createContainer(config, accessControlData) {
|
function createContainer(config, accessControlData) {
|
||||||
$q.when($scope.formValues.alwaysPull ? ImageService.pullImage($scope.config.Image, $scope.formValues.Registry) : null)
|
$q.when(!$scope.formValues.alwaysPull || ImageService.pullImage($scope.config.Image, $scope.formValues.Registry))
|
||||||
.then(function success() {
|
|
||||||
return ContainerService.createAndStartContainer(config);
|
|
||||||
})
|
|
||||||
.then(function success(data) {
|
|
||||||
var containerIdentifier = data.Id;
|
|
||||||
var userId = Authentication.getUserDetails().ID;
|
|
||||||
return ResourceControlService.applyResourceControl('container', containerIdentifier, userId, accessControlData, []);
|
|
||||||
})
|
|
||||||
.then(function success() {
|
|
||||||
Notifications.success('Container successfully created');
|
|
||||||
$state.go('containers', {}, {reload: true});
|
|
||||||
})
|
|
||||||
.catch(function error(err) {
|
|
||||||
Notifications.error('Failure', err, 'Unable to create container');
|
|
||||||
})
|
|
||||||
.finally(function final() {
|
.finally(function final() {
|
||||||
$('#createContainerSpinner').hide();
|
ContainerService.createAndStartContainer(config)
|
||||||
|
.then(function success(data) {
|
||||||
|
var containerIdentifier = data.Id;
|
||||||
|
var userId = Authentication.getUserDetails().ID;
|
||||||
|
return ResourceControlService.applyResourceControl('container', containerIdentifier, userId, accessControlData, []);
|
||||||
|
})
|
||||||
|
.then(function success() {
|
||||||
|
Notifications.success('Container successfully created');
|
||||||
|
$state.go('containers', {}, {reload: true});
|
||||||
|
})
|
||||||
|
.catch(function error(err) {
|
||||||
|
Notifications.error('Failure', err, 'Unable to create container');
|
||||||
|
})
|
||||||
|
.finally(function final() {
|
||||||
|
$('#createContainerSpinner').hide();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue