I’m writing a custom go plugin to validate scopes in JWT.
The plugin takes the “allowed scopes” for a given path as plugin configuration.
Although the plugin configuration is loaded correctly the first time, subsequent updates to the config are not picked up. Is there a way to rollout config changes or somehow send a signal to the plugin to reload its config?
Here is what the custom plugin configuration looks like.
The custom plugin is backed in the kong docker image
@sebbonnet Are you aware of the configure function as documented here? You could start with adding some logging to the function to see if it’s being called when you expect.
Besides deleting the KongPlugin configuration CR as no effect either, so it does seem that the plugin configuration is cached for the duration of the plugin server at least.
In fact looking at bit more in instance.go, there is a comment suggesting here that a new instance should be started in case of plugin config changes and the old one stopped. Are there any examples / guides on how to do that? How can I retrieve the current instance status to stop the old instance and how to generate a new instance status to start a new one?
The bug fix sounds promising.
I’m using kong docker image 3.6.0-ubuntu (I need the docker image as I’m bundling the custom plugin in it). I can see there is 3.6.1-ubuntu available but not 3.7.0 (or 3.6.2) yet - will you be releasing them soon, so I can test again?
3.7 is planned for mid-May. We do not have a date for the next 3.6 patch release.
In the meantime, you can test the fix with our nightly builds Docker – note that this build is for testing only and should not be used in prod environments.
Thanks for the feedback and sorry for the late reply - I was on leave
I’ve used the nightly build 3ff9ea0de5a9 and can confirm that the KongPlugin config is now correctly getting reloaded on changes. I’ve also checked that deleting a KongPlugin configuration CR is correctly picked up.
Thanks for your help with it.
I’ll be watching the next Kong releases to get the permanent fix in either 3.6.2 or 3.7