mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
fix(container-creation): preserve network aliases (#3401)
This commit is contained in:
parent
7f54584ed6
commit
61c38534a7
3 changed files with 17 additions and 7 deletions
|
@ -208,7 +208,8 @@ function ($q, $scope, $async, $state, $timeout, $transition$, $filter, Container
|
|||
IPAMConfig: {
|
||||
IPv4Address: $scope.formValues.IPv4,
|
||||
IPv6Address: $scope.formValues.IPv6
|
||||
}
|
||||
},
|
||||
Aliases: _.without($scope.config.NetworkingConfig.EndpointsConfig[networkMode].Aliases, $scope.config.Hostname)
|
||||
};
|
||||
|
||||
$scope.formValues.ExtraHosts.forEach(function (v) {
|
||||
|
@ -780,9 +781,9 @@ function ($q, $scope, $async, $state, $timeout, $transition$, $filter, Container
|
|||
return $q.when();
|
||||
}
|
||||
|
||||
var connectionPromises = Object.keys($scope.extraNetworks).map(function (networkName) {
|
||||
return NetworkService.connectContainer(networkName, newContainerId);
|
||||
});
|
||||
var connectionPromises = _.forOwn($scope.extraNetworks, function (network, networkName) {
|
||||
return NetworkService.connectContainer(networkName, newContainerId, _.without(network.Aliases, $scope.config.Hostname));
|
||||
});
|
||||
|
||||
return $q.all(connectionPromises);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue