fix(container-creation): handle extraHosts correctly (#4139)

* fix(container-creation): handle extraHosts correctly

* fix(container-creation): refactor for readability
pull/4173/head
itsconquest 2020-08-07 14:10:08 +12:00 committed by GitHub
parent 747fdae269
commit 1b88ca2285
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -280,11 +280,10 @@ angular.module('portainer.docker').controller('CreateContainerController', [
}
config.HostConfig.Dns = dnsServers;
$scope.formValues.ExtraHosts.forEach(function (v) {
if (v.value) {
config.HostConfig.ExtraHosts.push(v.value);
}
});
config.HostConfig.ExtraHosts = _.map(
_.filter($scope.formValues.ExtraHosts, (v) => v.value),
'value'
);
}
function prepareLabels(config) {