[bugfix] Pinot config env substitution#10726
[bugfix] Pinot config env substitution#10726dd-willgan wants to merge 2 commits intoapache:masterfrom
Conversation
| } | ||
| return rawProperty.toString(); | ||
| } | ||
| return _configuration.getString(relaxPropertyName(name), defaultValue); |
There was a problem hiding this comment.
we should probably keep the original logic for this one? (maybe check null first)
i don't think this change is needed as long as the previous bug fix is in. please double check
There was a problem hiding this comment.
If I understood that mapValue() method correctly, using > 1 was on purpose. Basically, if a config has multi string values, those values are combined to a comma separated string; otherwise, return the raw property.
After discussion with @dd-willgan, I'm testing some ideas here: #10785, mainly to keep things backward compatible as much as possible. Let's see how that one goes.
walterddr
left a comment
There was a problem hiding this comment.
lgtm mostly. good catch
|
Closing since resolved in #10785, thanks @klsince and @walterddr |
|
👍 |
Fix environment variable substitution for specific configs in #10719
access.control.init.passwordin controller configcontroller.segment.fetcher.auth.tokenin controller configpinot.server.segment.fetcher.auth.token,pinot.server.segment.uploader.auth.token, andpinot.server.instance.auth.tokenin server configChanges
String PinotConfiguration.getProperty(String name, String defaultValue)to callString CompositeConfiguration.getProperty(String name, String defaultValue)(which performs interpolation)access.control.init.passwordsince it uses this functionObject CommonConfigurationUtils mapValue(String key, Configuration configuration)to utilize the output ofCompositeConfiguration.getStringArrayfor greater than 0 outputs instead of greater than 1auth.tokenconfigs, which are parsed by the AuthProviderUtils class https://github.com/dd-willgan/pinot/blob/ea75326da28ef8c4176b463296a5067b6cac2261/pinot-common/src/main/java/org/apache/pinot/common/auth/AuthProviderUtils.java#L54toMapeventually calls themapValuefunction in question. As long as there 1 element in the output ofgetStringArraywe can take the result and join with commas.Tested
access.control.init.passwordas default user when using ZK-based controller auth was working, previously it wasn't