georgew5656 opened a new pull request, #15919: URL: https://github.com/apache/druid/pull/15919
Fixes [#XXXX.](https://github.com/apache/druid/issues/15875) ### Description When running the default docker image, we rely on the logic that transformers env variables into runtime properties for easier configuration (https://github.com/apache/druid/blob/master/distribution/docker/druid.sh#L147) This will transform a env variable like druid_metadata_storage_type=mysql into a runtime prop entry of druid.metadata.storage.type=mysql. There is a bug with properties that use underscores like druid.indexer.runner.k8s.podTemplate.index_kafka since those have underscores, they will not get properly replaced. e.g. druid_indexer_runner_k8s_podTemplate_index_kafka will get replaced with druid.indexer.runner.k8s.podTemplate.index.kafka instead of druid.indexer.runner.k8s.podTemplate.index_kafka #### Fixed the bug ... #### Renamed the class ... #### Added a forbidden-apis entry ... Although its not ideal to have underscores in runtime props (convention seems to be that runtime props should be camelCase), there is nothing preventing underscores in runtime props and in this case the runtime props are just matching our task type names. I fixed this bug by adding the ability to escape underscores in runtime props by including double underscores. e.g. druid_indexer_runner_k8s_podTemplate_index__kafka will properly be evaluated to druid.indexer.runner.k8s.podTemplate.index_kafka now. I used a double underscore as the escape character instead of \_ because these character go in the env variable name I added two additional sed lines to the env variable parser to parse these double underscores. #### Release note Allow specifying runtime props with underscores through env variables in the docker image with a escape character. ##### Key changed/added classes in this PR * `peon.sh` * `druid.sh` This PR has: - [X] been self-reviewed. - [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.) - [ ] added documentation for new or modified features or behaviors. - [ ] a release note entry in the PR description. - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links. - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md) - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader. - [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met. - [ ] added integration tests. - [X] been tested in a test Druid cluster. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
