Fix minor bug

This commit is contained in:
AaronDewes 2022-04-23 14:56:33 +00:00
parent b1bf16f787
commit ecb3456206

View File

@ -52,6 +52,7 @@ def configureMainPort(app: AppStage2, nodeRoot: str) -> AppStage3:
portToAppend = portAsEnvVar
mainPort = False
containerPort = False
if mainContainer.port:
portToAppend = "${{{}}}:{}".format(portAsEnvVar, mainContainer.port)
@ -83,15 +84,15 @@ def configureMainPort(app: AppStage2, nodeRoot: str) -> AppStage3:
nodeRoot, "apps", "networking.json"), path.join(nodeRoot, ".env"))
# Also set the port in metadata
app.metadata.port = int(port["publicPort"])
app.metadata.port = int(containerPort)
if mainPort:
app.metadata.internalPort = int(mainPort)
else:
app.metadata.internalPort = int(port["publicPort"])
app.metadata.internalPort = int(containerPort)
for registryApp in registry:
if registryApp['id'] == app.metadata.id:
registry[registry.index(registryApp)]['port'] = port["publicPort"]
registry[registry.index(registryApp)]['port'] = containerPort
registry[registry.index(registryApp)]['internalPort'] = app.metadata.internalPort
break