kong-pongo
kong-pongo copied to clipboard
Using custom Kong Configuration
Is is possible to customise the Kong configuration through a kong.conf file or through and environment variable?
for ex:
env:
MY_CUSTOM_ENV: mycustomval
in the tests you can specify enviornment variables, that will override whatever is in kong.conf
But i need this during development. Let's say i want to connect to AWS secret manager, i'll have to add few environment variables.
see here: https://github.com/Kong/kong-plugin/blob/master/spec/myplugin/02-integration_spec.lua#L29-L36
each entry in that table is exported. For example it has plugins = "..."
. that value will be exported as export "KONG_PLUGINS=..."
before starting Kong.
This allows you to override all of the kong.conf
file settings
If i'm not wrong that will take affect only during test runs. But what if i want to do something like:
pongo up
pongo shell
kms
and then:
pongo expose
Make code code changes in the plugin and i need a custom config like said above?
after you start the shell (before kms
in your example) you can add them?
If you want to automate it you can use the initialization scripts. See https://github.com/Kong/kong-pongo?tab=readme-ov-file#test-initialization
after you start the shell (before kms in your example) you can add them?
I tried but i think it has no affect.
If you want to automate it you can use the initialization scripts. See https://github.com/Kong/kong-pongo?tab=readme-ov-file#test-initialization
Again we are talking about tests here. And my requirement is not with tests but with development.
One hacky workaround is to simply add these env vars in the assets/docker-compose.yaml
in the pongo source itself.
the test initialization scripts run whenever a container is started, either on run
or on shell
. So that should work for your use case.
Please provide more details and exact commands you tried with expected and received output.