Skip to content
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

Expose router in plugin manager #4020

Merged
merged 1 commit into from Dec 1, 2021
Merged

Conversation

bhoriuchi
Copy link
Contributor

Addresses #2777 by

  • adding a private router property to the plugin manager along with get and set accessor methods
  • adding a conditional override of the runtime param router value if set on the plugin manager

Copy link
Member

@tsandall tsandall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR and sorry for the slightly delayed response!

I don't have a problem with exposing the router on the manager but I'd like to see some small tweaks to the PR. Let me know if you think the ones I outlined below will work!

plugins/plugins.go Outdated Show resolved Hide resolved
runtime/runtime.go Outdated Show resolved Hide resolved
@bhoriuchi
Copy link
Contributor Author

No worries. I will check this out next week as I am currently away for the holiday

@bhoriuchi
Copy link
Contributor Author

@tsandall, I have made the suggested updates. Please re-review. Thanks!

srenatus
srenatus previously approved these changes Dec 1, 2021
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing this 👏 🎉

@srenatus
Copy link
Contributor

srenatus commented Dec 1, 2021

Would you mind squashing those commits, and checking that the message roughly fits in with the guides here? https://www.openpolicyagent.org/docs/latest/contributing/#commit-messages

Thank you!

In order to expose the http router to plugins a private router property was added to the plugin manager along with a GetRouter method to access it. A router is also initialized in the NewRuntime function if one is not provided in the runtime params. Fixes open-policy-agent#2777

Signed-off-by: Branden Horiuchi <Branden.Horiuchi@blackline.com>
@bhoriuchi
Copy link
Contributor Author

@srenatus commits squashed and message updated.

@tsandall tsandall merged commit cfa4c5a into open-policy-agent:main Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants