Skip to content

Setting an environment variable for a (go) function in a k8s env using the admin cli #23134

Closed Answered by beelis
beelis asked this question in Q&A
Discussion options

You must be logged in to vote

After some discussion on the pulsar slack channel it seems that custom-runtime-options are only supported in the java runtime. Workaround is to define the log level in the userConfig and set the level manually in the go function:

function config file:

tenant: "functions-test"
namespace: "test-namespace"
inputs: ["persistent://functions-test/test-namespace/test_src"]
output: "persistent://functions-test/test-namespace/test_result"
userConfig:
  logLevel: "DEBUG"

setting log level in the go function:

	if logLevel, err := logrus.ParseLevel(config.LogLevel); err == nil {
		logrus.SetLevel(logLevel)
	}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@beelis
Comment options

Answer selected by beelis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant