vaihtovirta opened a new pull request #8132:
URL: https://github.com/apache/pulsar/pull/8132


   ### Motivation
   
   Currently, pulsar functions written in Golang have no access to the content 
of the user-config parameter from admin CLI.
   That's the simplest way to pass custom configuration into a go function 
right now because neither secretsMap nor Kubernetes runtime is available for 
Golang functions yet.
   
   **Note**: For the `secretsMap` parameter, the same technique can be used, 
but this has to be addressed in a separate PR.
   
   ### Modifications
   
   - Added `String GoInstanceConfig#userConfig` attribute
   - Propagated user-config parameter in `RuntimeUtils.getGoInstanceCmd`
   - Exposed userConfig in `pulsar-function-go` and made it available in the 
`FunctionContext`
   - Add unit tests for the affected code 
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   This change added tests and can be verified as follows:
   
     - Added unit tests for `RuntimeUtils.getGoInstanceCmd` in 
`pulsar-functions`
     - Added unit tests for `instanceConf` and `FunctionContext` in 
`pulsar-function-go`
   
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): (yes)
      - Run `go mod tidy` in `pulsar-function-go`.
     - The public API: (no)
      
     - The schema: (yes)
      - New attribute in GoInstanceConfig.java
     - The default values of configurations: (no)
     - The wire protocol: (no)
     - The rest endpoints: (no)
     - Anything that affects deployment: (don't know)
   
   ### Documentation
   The respective documentation has to be updated: [User 
Config#Go](https://github.com/apache/pulsar/blame/master/site2/docs/functions-develop.md#L574)
   
   **Question**: Does it have to be done in the scope of current PR? 


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to