fix(container-creation): populate logger config from existing container (#2602)

* refactor(container): change map function to lodash

* style(container): add semicolon
pull/2629/head
Chaim Lev-Ari 2019-01-16 02:34:28 +02:00 committed by Anthony Lapenna
parent 42365a52b1
commit fe63b4a156
1 changed files with 12 additions and 0 deletions

View File

@ -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;