1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

fix(service-details): fix an issue with invalid service restart policy (#1415)

This commit is contained in:
Duvel 2017-11-23 10:47:39 +01:00 committed by Anthony Lapenna
parent e51246ee78
commit 13d8d38bf9
6 changed files with 20 additions and 13 deletions

View file

@ -244,16 +244,16 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
config.UpdateConfig = {
Parallelism: service.UpdateParallelism,
Delay: service.UpdateDelay,
Delay: service.UpdateDelay * 1000000000,
FailureAction: service.UpdateFailureAction,
Order: service.UpdateOrder
};
config.TaskTemplate.RestartPolicy = {
Condition: service.RestartCondition,
Delay: service.RestartDelay,
Delay: service.RestartDelay * 1000000000,
MaxAttempts: service.RestartMaxAttempts,
Window: service.RestartWindow
Window: service.RestartWindow * 1000000000
};
if (service.Ports) {
@ -320,6 +320,12 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
service.LimitMemoryBytes = service.LimitMemoryBytes / 1024 / 1024 || 0;
service.ReservationMemoryBytes = service.ReservationMemoryBytes / 1024 / 1024 || 0;
}
function transformDurations(service) {
service.RestartDelay = service.RestartDelay / 1000000000 || 5;
service.RestartWindow = service.RestartWindow / 1000000000 || 0;
service.UpdateDelay = service.UpdateDelay / 1000000000 || 0;
}
function initView() {
var apiVersion = $scope.applicationState.endpoint.apiVersion;
@ -333,6 +339,7 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
transformResources(service);
translateServiceArrays(service);
transformDurations(service);
$scope.service = service;
originalService = angular.copy(service);