janhoy commented on code in PR #3240: URL: https://github.com/apache/solr/pull/3240#discussion_r1981064826
########## solr/core/src/java/org/apache/solr/cli/RunExampleTool.java: ########## @@ -305,7 +305,7 @@ protected void runExample(CommandLine cli, String exampleName) throws Exception "techproducts".equals(exampleName) ? "sample_techproducts_configs" : "_default"; boolean isCloudMode = !cli.hasOption(USER_MANAGED_OPTION); - String zkHost = cli.getOptionValue(CommonCLIOptions.ZK_HOST_OPTION); + String zkHost = CLIUtils.getZkHostFromCliOrEnv(cli); Review Comment: @epugh Not sure if runExample needs to read ENV. I mean, it is more of a canned experience, where we intentionally spin up an embedded ZK, right? But since it here reads the `--zk-host` option it must have been some thought that you should be able to run an example on an external Zookeeper, and if that even makes sense, then it follows that you should have the choice of also usin ZK_HOST env. ``` -z/--zk-host <zkHost> Zookeeper connection string; only used when running in SolrCloud mode using -c If neither ZK_HOST is defined in solr.in.sh nor the -z parameter is specified, an embedded ZooKeeper instance will be launched. Set the ZK_CREATE_CHROOT environment variable to true if your ZK host has a chroot path, and you want to create it automatically. ``` There is of course a risk that some user has defined a `ZK_HOST´ in her local terminal, and that being picked up by magic when running an example. 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. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org