dd-willgan opened a new pull request, #10726:
URL: https://github.com/apache/pinot/pull/10726

   Fix environment variable substitution for specific configs in #10719 
   
     - Fix `access.control.init.password` in controller config
     - Fix `controller.segment.fetcher.auth.token` in controller config
     - Fix `pinot.server.segment.fetcher.auth.token`, 
`pinot.server.segment.uploader.auth.token`, and 
`pinot.server.instance.auth.token` in server config
   
   Changes
   
   - Change `String PinotConfiguration.getProperty(String name, String 
defaultValue)` to call `String CompositeConfiguration.getProperty(String name, 
String defaultValue)` (which performs interpolation)
     - This will fix `access.control.init.password` since it uses this function
     - 
https://github.com/dd-willgan/pinot/blob/ea75326da28ef8c4176b463296a5067b6cac2261/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java#L827-L829
   - Change `Object CommonConfigurationUtils mapValue(String key, Configuration 
configuration)` to utilize the output of 
`CompositeConfiguration.getStringArray` for greater than 0 outputs instead of 
greater than 1
     - This will fix all the `auth.token` configs, 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#L54
     - `toMap` eventually calls the `mapValue` function in question. As long as 
there 1 element in the output of `getStringArray` we can take the result and 
join with commas.
   
   Tested
   
   - Added a test case checking the behavior with system properties (also 
interpolated but easier to mock than environment variables)
   - Built Pinot Docker image / deployed with Helm
     - Verified that environment variable substitution was working for 
`access.control.init.password` as default user when using ZK-based controller 
auth was working, previously it wasn't
     - Verified that the environment variable substitution was working for the 
auth tokens by creating a table, uploading a test segment to controller, and 
verifying that server was able to download the segment. Previously it wasn't 
since it didn't pass the right credentials when trying to download the segment 
from the controller


-- 
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]

Reply via email to