smolnar82 commented on pull request #326: URL: https://github.com/apache/knox/pull/326#issuecomment-619809824
My two cents: - checking the `username` and `passwordAlias` here is not enough because in CM discovery Knox defaults to `cm.discovery.user` and `cm.discovery.password` if they are not defined -> following the new logic, performing the emptyness check here does not mean the user does not want service discovery - checking the `address` here is not enough because in Ambari discovery Knox defaults to the value of `gateway.discovery.default.address` Gateway configuration What if we simply rely on the discovery type. If none is selected -> no discovery will be performed. Discovery type is still optional (that is, the end-user does not need to select one) and makes the code easier to read and understand: - `performDiscovery` should only be invoked if discovery type is not `null` [here](https://github.com/apache/knox/blob/v1.4.0/gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorHandler.java#L109) - the [default discovery type](https://github.com/apache/knox/blob/v1.4.0/gateway-topology-simple/src/main/java/org/apache/knox/gateway/topology/simple/SimpleDescriptorHandler.java#L71) should be removed - we may want to add some `WARN` level messages in the log in case discovery type is not selected but any of the other discovery related configuration is present. This check should be implemented in `SimpleDescriptorImpl` instead of in `SimpleDescriptorHandler` where only the log should be placed. Any thoughts? ---------------------------------------------------------------- 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]
