mesos / elasticsearch

Elasticsearch on Mesos
Apache License 2.0
242 stars 90 forks source link

Allow subpaths in ZK URLs #570

Closed defect closed 7 years ago

defect commented 8 years ago

We have development mesos clusters that use the same ZK cluster but chrooted on different paths under /mesos/{dev1,dev2,...}. I tried to spin up the elasticsearch framework on one of these but got stopped by a ZKAddressException.

The reason is that the ZK_NODE_REG part of the full ADDRESS_REGEX that validates ZK URLs in org.apache.mesos.elasticsearch.common.zookeeper.model.ZKAddress only allows for one path segment beneath the root. I.e. /mesos and /my_mesos_cluster are valid, but /mesos/cluster1 isn't.

This PR relaxes the ZK_NODE_REG regex a bit to allow for subpaths in the ZK URL. Commit 52ab30b adds a couple of tests that fail with the current regex, and 57084ed is the actual change to the regex which makes the tests pass.

Please let me know what you think! Thanks.

frankscholten commented 7 years ago

LGTM

Thanks for your contribution @defect!