mirror of https://github.com/portainer/portainer
fix(service-details): avoid sending unmodified restart policy settings when updating a service (#1576)
parent
362f036a68
commit
8ae3abf29e
|
@ -277,12 +277,14 @@ function ($q, $scope, $transition$, $state, $location, $timeout, $anchorScroll,
|
|||
Order: service.UpdateOrder
|
||||
};
|
||||
|
||||
config.TaskTemplate.RestartPolicy = {
|
||||
Condition: service.RestartCondition,
|
||||
Delay: ServiceHelper.translateHumanDurationToNanos(service.RestartDelay) || 5000000000,
|
||||
MaxAttempts: service.RestartMaxAttempts,
|
||||
Window: ServiceHelper.translateHumanDurationToNanos(service.RestartWindow) || 0
|
||||
};
|
||||
if ($scope.hasChanges(service, ['RestartCondition', 'RestartDelay', 'RestartMaxAttempts', 'RestartWindow'])){
|
||||
config.TaskTemplate.RestartPolicy = {
|
||||
Condition: service.RestartCondition,
|
||||
Delay: ServiceHelper.translateHumanDurationToNanos(service.RestartDelay) || 5000000000,
|
||||
MaxAttempts: service.RestartMaxAttempts,
|
||||
Window: ServiceHelper.translateHumanDurationToNanos(service.RestartWindow) || 0
|
||||
};
|
||||
}
|
||||
|
||||
config.TaskTemplate.LogDriver = null;
|
||||
if (service.LogDriverName) {
|
||||
|
|
Loading…
Reference in New Issue