risdenk commented on a change in pull request #267: KNOX-2238 CM discovery -
Add TLS support to Phoenix auto discovery
URL: https://github.com/apache/knox/pull/267#discussion_r381292926
##########
File path:
gateway-discovery-cm/src/main/java/org/apache/knox/gateway/topology/discovery/cm/model/phoenix/PhoenixServiceModelGenerator.java
##########
@@ -58,14 +59,24 @@ public ServiceModel generateService(ApiService
service,
ApiServiceConfig serviceConfig,
ApiRole role,
ApiConfigList roleConfig) {
+
String hostname = role.getHostRef().getHostname();
- // Phoenix Query Server does not support https
+ String sslEnabledRaw = getRoleConfigValue(roleConfig, SSL_ENABLED);
Review comment:
This can be simplified. No need to store `sslEnabledRaw`. just do something
like:
```
if (Boolean.parseBoolean(getRoleConfigValue(roleConfig, SSL_ENABLED))) {
scheme = "https";
}
```
`Boolean.parseBoolean` will handle null correctly and return false.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services