1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 05:45:22 +02:00

fix(templates): fix the ability to pull an image within an offline environment (#961)

This commit is contained in:
Anthony Lapenna 2017-06-29 16:05:39 +02:00 committed by GitHub
parent 6609c2e928
commit 6d401dcd59
5 changed files with 27 additions and 10 deletions

View file

@ -299,7 +299,7 @@ function ($q, $scope, $state, $stateParams, $filter, Container, ContainerHelper,
};
function createContainer(config, accessControlData) {
$q.when(!$scope.formValues.alwaysPull || ImageService.pullImage($scope.config.Image, $scope.formValues.Registry))
$q.when(!$scope.formValues.alwaysPull || ImageService.pullImage($scope.config.Image, $scope.formValues.Registry, true))
.finally(function final() {
ContainerService.createAndStartContainer(config)
.then(function success(data) {

View file

@ -47,7 +47,7 @@ function ($scope, $stateParams, $state, $timeout, ImageService, RegistryService,
RegistryService.retrieveRegistryFromRepository(repository)
.then(function success(data) {
var registry = data;
return ImageService.pullImage(repository, registry);
return ImageService.pullImage(repository, registry, false);
})
.then(function success(data) {
Notifications.success('Image successfully pulled', repository);

View file

@ -42,7 +42,7 @@ function ($scope, $state, ImageService, Notifications, Pagination, ModalService)
$('#pullImageSpinner').show();
var image = $scope.formValues.Image;
var registry = $scope.formValues.Registry;
ImageService.pullImage(image, registry)
ImageService.pullImage(image, registry, false)
.then(function success(data) {
Notifications.success('Image successfully pulled', image);
$state.reload();

View file

@ -69,7 +69,7 @@ function ($scope, $q, $state, $stateParams, $anchorScroll, $filter, ContainerSer
generatedVolumeIds.push(volumeId);
});
TemplateService.updateContainerConfigurationWithVolumes(templateConfiguration, template, data);
return ImageService.pullImage(template.Image, template.Registry);
return ImageService.pullImage(template.Image, { URL: template.Registry }, true);
})
.then(function success(data) {
return ContainerService.createAndStartContainer(templateConfiguration);