From fe63b4a156ae46a2ae552f5e662bbe7249da6de2 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Wed, 16 Jan 2019 02:34:28 +0200 Subject: [PATCH] fix(container-creation): populate logger config from existing container (#2602) * refactor(container): change map function to lodash * style(container): add semicolon --- .../containers/create/createContainerController.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/docker/views/containers/create/createContainerController.js b/app/docker/views/containers/create/createContainerController.js index 44f3af9dd..552d9e65c 100644 --- a/app/docker/views/containers/create/createContainerController.js +++ b/app/docker/views/containers/create/createContainerController.js @@ -509,6 +509,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai $scope.fromContainer = fromContainer; $scope.config = ContainerHelper.configFromContainer(fromContainer.Model); loadFromContainerCmd(d); + loadFromContainerLogging(d); loadFromContainerPortBindings(d); loadFromContainerVolumes(d); loadFromContainerNetworkConfig(d); @@ -525,6 +526,17 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai }); } + function loadFromContainerLogging(config) { + var logConfig = config.HostConfig.LogConfig; + $scope.formValues.LogDriverName = logConfig.Type; + $scope.formValues.LogDriverOpts = _.map(logConfig.Config, function (value, name) { + return { + name: name, + value: value + }; + }); + } + function initView() { var nodeName = $transition$.params().nodeName; $scope.formValues.NodeName = nodeName;