mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(services): let Docker automatically assign port when PublishedPort is not defined (#747)
This commit is contained in:
parent
9fda8f9c92
commit
ffca440135
2 changed files with 16 additions and 2 deletions
|
@ -197,6 +197,13 @@ function ($scope, $stateParams, $state, $location, $anchorScroll, Service, Servi
|
|||
MaxAttempts: service.RestartMaxAttempts,
|
||||
Window: service.RestartWindow
|
||||
};
|
||||
|
||||
service.Ports.forEach(function (binding) {
|
||||
if (binding.PublishedPort === null || binding.PublishedPort === '') {
|
||||
delete binding.PublishedPort;
|
||||
}
|
||||
});
|
||||
|
||||
config.EndpointSpec = {
|
||||
Mode: config.EndpointSpec.Mode || 'vip',
|
||||
Ports: service.Ports
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue