forked from michael.heier/citadel-core
Merge branch 'beta' into c-lightning
This commit is contained in:
commit
969d4e7796
|
@ -104,6 +104,10 @@ properties:
|
|||
type: array
|
||||
items:
|
||||
type: number
|
||||
requiredUdpPorts:
|
||||
type: array
|
||||
items:
|
||||
type: number
|
||||
description: Ports this container requires to be exposed to work properly
|
||||
port:
|
||||
type: number
|
||||
|
|
|
@ -86,6 +86,10 @@ def createComposeConfigFromV3(app: dict, nodeRoot: str):
|
|||
for container in newApp.containers:
|
||||
container.ports = container.requiredPorts
|
||||
del container.requiredPorts
|
||||
for container in newApp.containers:
|
||||
for udpPort in container.requiredUdpPorts:
|
||||
container.ports.append(udpPort)
|
||||
del container.requiredUdpPorts
|
||||
newApp = configureMainPort(newApp, nodeRoot)
|
||||
for container in newApp.containers:
|
||||
# TODO: Make this dynamic and not hardcoded
|
||||
|
|
|
@ -37,6 +37,7 @@ class Container:
|
|||
permissions: list = field(default_factory=list)
|
||||
port: Union[int, None] = None
|
||||
requiredPorts: list = field(default_factory=list)
|
||||
requiredUdpPorts: list = field(default_factory=list)
|
||||
preferredOutsidePort: Union[int, None] = None
|
||||
requiresPort: Union[bool, None] = None
|
||||
environment: Union[dict, None] = None
|
||||
|
|
|
@ -149,9 +149,11 @@ def getPortsV3App(app, appId):
|
|||
validatePort(appContainer, appContainer["preferredOutsidePort"], appId, 1)
|
||||
else:
|
||||
validatePort(appContainer, appContainer["port"], appId, 0)
|
||||
elif "requiredPorts" not in appContainer:
|
||||
elif "requiredPorts" not in appContainer and "requiredUdpPorts" not in appContainer:
|
||||
validatePort(appContainer, getNewPort(appPorts.keys()), appId, 0, True)
|
||||
if "requiredPorts" in appContainer:
|
||||
for port in appContainer["requiredPorts"]:
|
||||
realPort = int(str(port).split(":")[0])
|
||||
validatePort(appContainer, realPort, appId, 2)
|
||||
validatePort(appContainer, port, appId, 2)
|
||||
if "requiredUdpPorts" in appContainer:
|
||||
for port in appContainer["requiredUdpPorts"]:
|
||||
validatePort(appContainer, port, appId, 2)
|
Loading…
Reference in New Issue
Block a user