-
Notifications
You must be signed in to change notification settings - Fork 357
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
Allow configuration of bundle download behaviour of open-policy-agent filter #3464
base: master
Are you sure you want to change the base?
Allow configuration of bundle download behaviour of open-policy-agent filter #3464
Conversation
fb17e73
to
d2b81c0
Compare
|
||
func (opa *OpenPolicyAgentInstance) verifyAllPluginsStarted() error { | ||
allPluginsReady := true | ||
for pluginName, status := range opa.manager.PluginStatus() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we make it explicit that we only wait for the bundle and discovery plugin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is checking the status of all plugins to align with the normal startup without the control loop
d2b81c0
to
a38dc7f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a first pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds configuration options to control the periodic triggering behavior of the Open Policy Agent filter, allowing manual override of the automatic bundle downloads and discovery triggers. Key changes include:
- Adding new configuration flags and options for override behavior, plugin trigger interval, and maximum trigger jitter.
- Updating the startup and plugin trigger logic in both production and test code.
- Introducing configuration hook changes for manual override in plugin triggers.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
skipper.go | Adds new options for enabling override of period triggers and configuring intervals/jitter. |
filters/openpolicyagent/openpolicyagent_test.go | Updates tests to cover various scenarios for plugin trigger override and error handling. |
filters/openpolicyagent/openpolicyagent.go | Implements manual override handling for plugin triggers and adds retry logic. |
filters/openpolicyagent/internal/confighook.go and confighook_test.go | Introduces a manual override hook for discovery and bundle plugin configurations. |
config/config.go and config/config_test.go | Updates configuration schema and tests with new flags related to plugin trigger override. |
@torwunder FYI, I am testing what Copilot review is capable of so I've requested a review from it. |
a38dc7f
to
47fbff0
Compare
- control timing of f.ex. bundle download directly - fail fast for non-recoverable errors Signed-off-by: Torsten Wunderlich <[email protected]>
47fbff0
to
ebd3bea
Compare
config/config.go
Outdated
OpenPolicyAgentMaxRequestBodySize int64 `yaml:"open-policy-agent-max-request-body-size"` | ||
OpenPolicyAgentMaxMemoryBodyParsing int64 `yaml:"open-policy-agent-max-memory-body-parsing"` | ||
EnableOpenPolicyAgent bool `yaml:"enable-open-policy-agent"` | ||
EnableOpenPolicyAgentOverridePeriodTriggers bool `yaml:"enable-open-policy-agent-override-period-triggers"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it have -plugin
in the name?
Also please put related configs next to each other:
enable-open-policy-agent[-plugin]-override-period-triggers
open-policy-agent-plugin-trigger-interval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of #3464 (comment)
bce1f8a
to
5aa86e1
Compare
Signed-off-by: Torsten Wunderlich <[email protected]>
5aa86e1
to
8be65b3
Compare
Signed-off-by: Torsten Wunderlich <[email protected]>
Signed-off-by: Torsten Wunderlich <[email protected]>
Signed-off-by: Torsten Wunderlich <[email protected]>
Signed-off-by: Torsten Wunderlich <[email protected]>
Addresses: #3119
Solution
add option to override the period trigger for discovery and bundle plugins
Context
The current (and future default) behaviour is relying on the configurable startup timeout to determine if the open-policy-agent filter can successfully serve requests (if it was able to download the bundles, aso).
The solution is based on a [change](add option to override period trigger for plugin) in upstream opa that exposes the httpError struct on the trigger method.