Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add schema and default for getting all discovery servers instead of just one #290

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading