Skip to content

Commit

Permalink
Add schema and default for getting all discovery servers instead of j…
Browse files Browse the repository at this point in the history
…ust one

Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs committed Dec 12, 2023
1 parent 206b452 commit 499a586
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

All notable changes to the Zlux App Server package will be documented in this file.

## v2.14.0
- Enhancement: Updated schema to specify multiple discovery servers.

## v2.13.0
- Enhancement: Updated schema to allow cipher customization in IANA format. (#284)
- Enhancement: Updated schema to allow curve customization. (#284)
Expand Down
10 changes: 10 additions & 0 deletions defaults/serverConfig/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,21 @@ components:
mediationLayer:
server:
# strange but true: to contact discovery in a container, instead reach for the gateway hostname.
# DEPRECATED. Use discoveryUrls instead.
hostname: '${{ function a() {
if (process.env.ZWE_RUN_IN_CONTAINER=="true" && process.env.ZWE_GATEWAY_HOST) {
return process.env.ZWE_GATEWAY_HOST;
} else {
return zowe.externalDomains[0] } };
a() }}'
discoveryUrls: '${{ function a() {
if (process.env.ZWE_RUN_IN_CONTAINER=="true" && process.env.ZWE_GATEWAY_HOST) {
return ["https://"+process.env.ZWE_GATEWAY_HOST+":"+components.discovery.port+"/eureka/"];
} else if (process.env.ZWE_DISCOVERY_SERVICES_LIST) {
return process.env.ZWE_DISCOVERY_SERVICES_LIST.split(",");
} else {
return ["https://"+zowe.externalDomains[0]+":"+components.discovery.port+"/eureka/"];
a() }}'
# usually, externalDomains is where gateway is. But on containers, this isnt accessible to containers, so
# HACK: special var ZWE_GATEWAY_HOST is used instead
gatewayHostname: '${{ function a() {
Expand All @@ -116,6 +125,7 @@ components:
} else {
return zowe.externalDomains[0] } };
a() }}'
# DEPRECATED. Use discoveryUrls instead.
port: ${{ components.discovery.port }}
# strange but true: to contact gateway in a container, dont use the external port.
gatewayPort: '${{ function a() {
Expand Down
12 changes: 11 additions & 1 deletion schemas/app-server-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@
"type": "boolean",
"description": "Controls if connections to the API Mediation Layer gateway and/or discovery service should be HTTP or HTTPS"
},
"discoveryUrls": {
"type": "array",
"description": "A list of URLs where discovery servers can be found. URLs must be in the form of 'https://host:port/eureka/'. This will be used instead of the 'hostname' and 'port' values if present.",
"items": {
"type": "string",
"pattern": "https:\/\/.*:[0-9].*\/eureka\/"
}
},
"gatewayHostname": {
"type": "string",
"format": "hostname",
Expand All @@ -125,7 +133,8 @@
"hostname": {
"type": "string",
"format": "hostname",
"description": "The hostname or IP where the Zowe Discovery service is running"
"description": "The hostname or IP where the Zowe Discovery service is running",
"deprecated": true
},
"gatewayPort": {
"oneOf": [
Expand All @@ -139,6 +148,7 @@
{ "$ref": "/schemas/v2/server-common#zoweTcpPort" },
{ "$ref": "/schemas/v2/server-common#zoweReservedTcpPort" },
],
"deprecated": true,
"description": "The port where the Zowe Discovery service is running"
},
"enabled": {
Expand Down

0 comments on commit 499a586

Please sign in to comment.