diff --git a/CHANGELOG.md b/CHANGELOG.md index face090..b5cb675 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to the Zlux App Server package will be documented in this fi ## v2.12.0 - enhancement: new versions of components can change the location of their plugins, as the app-server will now re-inspect the plugin locations on each startup. (#280) +- bugfix: Removed error message "components/app-server/bin/configure.sh 26: .: FSUM6807 expression syntax error" seen in startup of Zowe in v2.11.0, caused by incorrect shell syntax. (#283) ## v2.11.0 diff --git a/bin/configure.sh b/bin/configure.sh index ec64045..36276d8 100755 --- a/bin/configure.sh +++ b/bin/configure.sh @@ -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 <&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 <&1) + echo "${zss_parsed_def}" > "${zss_registration_yaml}" + chmod 770 "${zss_registration_yaml}" + fi + + unset ZSS_PORT + unset ZSS_PROTOCOL + fi fi fi diff --git a/defaults/serverConfig/defaults.yaml b/defaults/serverConfig/defaults.yaml index 38fc57e..c2daa70 100644 --- a/defaults/serverConfig/defaults.yaml +++ b/defaults/serverConfig/defaults.yaml @@ -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() }}' @@ -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 }}