-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Allow Reconfiguration when config file changes #474
Comments
Hey, in the upcoming v3 version I added at least support for updating existing targets using secretRefs. E.g. you have a slack target and configure the webhook via secretRef, the secret changes - it will update the target. It depends on what you try to update/change but this would also be an entry point to add targets during runtime. https://github.com/kyverno/policy-reporter/blob/3.x/pkg/target/collection.go There are plans to provide CRDs for the configuration of targets in the future, but there is no timetable for this yet. |
interesting, I was exploring the Cobra/Viper route, I have it to a point where I can change the target config slack channel and it propagates the change, but it sends messages to the new channel + the webhook default channel. On the api side the targets never get refreshed in fact it's strange because hiting /v1/targets never reaches the I will take a look at your v3 commits and see if I can figure out a way, the only thing I do not want to do is add a wrapper on the reporter to watch for the config file and restart the process, that's my last option. I Will probably submit an MR tagged as WIP so you can see what I'm doing. Thanks for the help and time!. |
In v3 the targets.Collection is the "source of truth" for the targets handler, pushes, etc. So you only need a way to add a new target to the collection or update an existing one. Should be a better starting point as in v2. |
@jescarri as I read your initial use case is based on namespace labels, the new policy reporter v3 now supports namespace label selector for target filter. Maybe this could also solve your problem. |
Hello, I'm trying to add a way to hot-reload kyverno-policy-reporter when the config file changes.
I have an external process that generates slack-target configuration based of namespace labels, I've been trying to add this feature but I'm a bit lost on what is the process to load and propagate the configuration.
I have some working bits, reload configuration and generate new targets but I cannot get it to propagate to the api or slack channel notification.
Let me know if this is something that can be done with the current code-base, I'm happy to add the code.
Thanks!
The text was updated successfully, but these errors were encountered: