Set the udp ports in docker configuration

Part of #504
This commit is contained in:
Girish Ramakrishnan
2018-08-12 22:47:59 -07:00
parent 8bc7dc9724
commit c29eef4c14
3 changed files with 13 additions and 9 deletions

View File

@@ -207,8 +207,9 @@ function validatePortBindings(portBindings, manifest) {
// it is OK if there is no 1-1 mapping between values in manifest.tcpPorts and portBindings. missing values implies
// that the user wants the service disabled
const tcpPorts = manifest.tcpPorts || { };
const udpPorts = manifest.udpPorts || { };
for (let portName in portBindings) {
if (!(portName in tcpPorts)) return new AppsError(AppsError.BAD_FIELD, `Invalid portBindings ${portName}`);
if (!(portName in tcpPorts) && !(portName in udpPorts)) return new AppsError(AppsError.BAD_FIELD, `Invalid portBindings ${portName}`);
}
return null;