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

Fixed env merging to wrong part of yaml heirarchy #268

Merged
merged 3 commits into from
Jul 25, 2023
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
5 changes: 4 additions & 1 deletion bin/install-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ if [ -n "${ZWE_zowe_workspaceDirectory}" -a -n "${ZWE_zowe_runtimeDirectory}" ];
ZLUX_CONTAINER_MODE=1
INSTALL_NO_NODE=1
fi
if [ ! -d "${COMPONENT_HOME}/share/zlux-app-server" ]; then
COMPONENT_HOME=${ZWE_zowe_runtimeDirectory}/components/app-server
fi
fi
zlux_path="$COMPONENT_HOME/share"

if [ -z "$INSTALL_NO_NODE" ]; then
zlux_path="$COMPONENT_HOME/share"
setVars
if [ ! -e "${ZWE_zowe_workspaceDirectory}/app-server/plugins/org.zowe.zlux.json" ]; then
cd ${zlux_path}/zlux-app-server/lib
Expand Down
18 changes: 16 additions & 2 deletions defaults/serverConfig/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,22 @@ components:
loopbackAddress: "${{ function a(){ if (process.env.ZOWE_LOOPBACK_ADDRESS) { return process.env.ZOWE_LOOPBACK_ADDRESS; } else { return undefined; } }; a() }}"
mediationLayer:
server:
hostname: ${{ zowe.externalDomains[0] }}
gatewayHostname: ${{ zowe.externalDomains[0] }}
# if ZWE_DISCOVERY_SERVICES_LIST exists, its more accurate than zowe.externalDomains, as that doesn't handle containers well.
# if exists, its in the format of "https://discovery-0.discovery-service.zowe.svc.cluster.local:7553/eureka/"
hostname: '${{ function a() {
if (process.env.ZWE_DISCOVERY_SERVICES_LIST) {
return process.env.ZWE_DISCOVERY_SERVICES_LIST.split(",")[0].split("/")[2].split(":")[0];
} else {
return zowe.externalDomains[0] } };
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() {
if (process.env.ZWED_node_container=="true" && process.env.ZWE_GATEWAY_HOST) {
return process.env.ZWE_GATEWAY_HOST;
} else {
return zowe.externalDomains[0] } };
a() }}'
port: ${{ components.discovery.port }}
gatewayPort: ${{ zowe.externalPort }}
isHttps: true
Expand Down
4 changes: 2 additions & 2 deletions lib/zluxArgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ if(process.env.overrideFileConfig !== "false"){
if (cluster.isMaster) {
console.log('\nZWED5015I - Processed environment variables:\n'+JSON.stringify(envConfig, null, 2));
}
configJSON = mergeUtils.deepAssign(configJSON, envConfig);
configJSON = mergeUtils.deepAssign(configJSON.components['app-server'], envConfig);
}
if (userInput.D) {
if (cluster.isMaster) {
console.log('\nZWED5016I - Processed -D arguments:\n'+JSON.stringify(userInput.D, null, 2));
}
configJSON = mergeUtils.deepAssign(configJSON, userInput.D);
configJSON = mergeUtils.deepAssign(configJSON.components['app-server'], userInput.D);
}
} else {
console.log("ZWED5017I - Using config JSON, discarding CLI args");
Expand Down
Loading