mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 14:29:40 +02:00
refactor(image): refactor the code used in image and image details controller (#705)
This commit is contained in:
parent
c2e63070e6
commit
24b51a7e87
8 changed files with 245 additions and 167 deletions
|
@ -21,17 +21,10 @@ angular.module('portainer.services')
|
|||
};
|
||||
|
||||
service.createTemplateConfiguration = function(template, containerName, network, containerMapping) {
|
||||
var imageConfiguration = service.createImageConfiguration(template);
|
||||
var imageConfiguration = ImageHelper.createImageConfigForContainer(template.Image, template.Registry);
|
||||
var containerConfiguration = service.createContainerConfiguration(template, containerName, network, containerMapping);
|
||||
containerConfiguration.Image = imageConfiguration.fromImage + ':' + imageConfiguration.tag;
|
||||
return {
|
||||
container: containerConfiguration,
|
||||
image: imageConfiguration
|
||||
};
|
||||
};
|
||||
|
||||
service.createImageConfiguration = function(template) {
|
||||
return ImageHelper.createImageConfigForContainer(template.Image, template.Registry);
|
||||
return containerConfiguration;
|
||||
};
|
||||
|
||||
service.createContainerConfiguration = function(template, containerName, network, containerMapping) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue