fix(container-creation): ensure exposedPorts exists (#3770)

pull/3773/head
Maxime Bajeux 2020-04-29 04:33:37 +02:00 committed by GitHub
parent 7f0ce61413
commit 7fe7ce1a0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -89,6 +89,11 @@ angular.module('portainer.docker').factory('ContainerHelper', [
EndpointsConfig: {},
};
config.NetworkingConfig.EndpointsConfig = container.NetworkSettings.Networks;
if (config.ExposedPorts === undefined) {
config.ExposedPorts = {};
}
if (mode.indexOf('container:') !== -1) {
delete config.Hostname;
delete config.ExposedPorts;