Skip to content

Commit

Permalink
Merge pull request #282 from zowe/v2.x/rc
Browse files Browse the repository at this point in the history
merge rc into staging
  • Loading branch information
1000TurquoisePogs authored Oct 11, 2023
2 parents fa71348 + 56cb92d commit fb275ae
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
44 changes: 21 additions & 23 deletions bin/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,28 @@ fi

cd ${COMPONENT_HOME}/share/zlux-app-server/bin

if [ -n "$ZWE_components_app_server_node_mediationLayer_enabled" -a -z "$ZWE_components_app_server_agent_mediationLayer_enabled" ]; then
if [ "${ZWE_RUN_ON_ZOS}" != "true" ]; then
zss_def_template="zss.apiml_static_reg.yaml.template"
zss_configured=false
if [ -n "${ZWE_components_app_server_agent_https_port}" ]; then
export ZSS_PORT="${ZWE_components_app_server_agent_https_port}"
export ZSS_PROTOCOL=https
zss_configured=true
elif [ -n "${ZWED_components_app_server_agent_http_port}" ]; then
export ZSS_PORT="${ZWE_components_app_server_http_port}"
export ZSS_PROTOCOL=http
zss_configured=true
fi

if [ "${zss_configured}" = "true" ] && [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ]; then
zss_registration_yaml=${ZWE_STATIC_DEFINITIONS_DIR}/zss.apiml_static_reg_yaml_template.${ZWE_CLI_PARAMETER_HA_INSTANCE}.yml
zss_def="../${zss_def_template}"
zss_parsed_def=$( ( echo "cat <<EOF" ; cat "${zss_def}" ; echo ; echo EOF ) | sh 2>&1)
echo "${zss_parsed_def}" > "${zss_registration_yaml}"
chmod 770 "${zss_registration_yaml}"
fi
if [ "$ZWE_components_gateway_enabled" == "true" ]; then
if [ "$ZWE_components_zss_enabled" == "true" ]; then
if [ "${ZWE_RUN_ON_ZOS}" != "true" ]; then
zss_def_template="zss.apiml_static_reg.yaml.template"
export ZSS_PORT="${ZWE_components_zss_port}"
if [ "${ZWE_components_zss_tls}" != "false" ]; then
export ZSS_PROTOCOL=https
else
export ZSS_PROTOCOL=http
fi

unset ZSS_PORT
unset ZSS_PROTOCOL
if [ -n "${ZWE_STATIC_DEFINITIONS_DIR}" ]; then
zss_registration_yaml=${ZWE_STATIC_DEFINITIONS_DIR}/zss.apiml_static_reg_yaml_template.${ZWE_CLI_PARAMETER_HA_INSTANCE}.yml
zss_def="../${zss_def_template}"
zss_parsed_def=$( ( echo "cat <<EOF" ; cat "${zss_def}" ; echo ; echo EOF ) | sh 2>&1)
echo "${zss_parsed_def}" > "${zss_registration_yaml}"
chmod 770 "${zss_registration_yaml}"
fi

unset ZSS_PORT
unset ZSS_PROTOCOL
fi
fi
fi

Expand Down
15 changes: 10 additions & 5 deletions defaults/serverConfig/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,10 @@ components:
loopbackAddress: "${{ function a(){ if (process.env.ZOWE_LOOPBACK_ADDRESS) { return process.env.ZOWE_LOOPBACK_ADDRESS; } else { return undefined; } }; a() }}"
mediationLayer:
server:
# 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/"
# strange but true: to contact discovery in a container, instead reach for the gateway hostname.
hostname: '${{ function a() {
if (process.env.ZWE_DISCOVERY_SERVICES_LIST) {
return process.env.ZWE_DISCOVERY_SERVICES_LIST.split(",")[0].split("/")[2].split(":")[0];
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() }}'
Expand All @@ -78,7 +77,13 @@ components:
return zowe.externalDomains[0] } };
a() }}'
port: ${{ components.discovery.port }}
gatewayPort: ${{ zowe.externalPort }}
# strange but true: to contact gateway in a container, dont use the external port.
gatewayPort: '${{ function a() {
if (process.env.ZWE_RUN_IN_CONTAINER=="true") {
return components.gateway.port;
} else {
return zowe.externalPort } };
a() }}'
isHttps: true
cachingService:
enabled: ${{ components['app-server'].node.mediationLayer.enabled && components['caching-service'].enabled }}
Expand Down

0 comments on commit fb275ae

Please sign in to comment.