Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat: cache namespaces in targethandler #1908
feat: cache namespaces in targethandler #1908
Changes from 29 commits
6dbd7ff
c886a62
899cb49
ffdca05
ff170ba
1158dc1
9a96157
b4a4191
93c2615
57d00a9
5f68b9c
abc709d
90c17c1
b6f6af6
9569bf2
3d4e906
eb94380
6d91bba
fe7db44
4a26e30
dd3c192
bfa17e8
cb8914c
e125c91
9d7fd83
10b1213
7e5fda8
4163d8c
650b65a
b2d0a58
43ea0fc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
do we want to make this generic and replace
gatekeeper/pkg/audit/manager.go
Line 102 in a3d8a0d
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.
What do you mean by "make this generic"? Indicate that we should be able to cache other objects?
If so, we could, but we probably don't want to do that currently since we'd be duplicating OPA's cache. It's something we may want to consider as possible future work if we needed wider access to the cache, though.
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 think Sertaç is talking about that we have a different
nsCache
inaudit/manager.go
. I had thought about that initially when looking at Davis's PR, but I think that deduplication would be better suited in a different PR. Audit'snsCache
has slightly different uses, so changing that in this PR would make this change a bit larger (e.g. we'd have to figure out where to export the type so it's available from both locations). It's work that is easy to have as a follow-upThere 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.
*follow-up = after merging in the frameworks changes
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.
SGTM as a follow-up
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.
@willbeason Will your follow-on PR make it so HandleReview() always returns a gkReview?
Side note... with these changes, we will also be able to drop that
Unstable
field when passing to Rego, since Rego no longer has need for an injected namespaceThere 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.
On the first note: sure, I'll make sure of that. On the second, it's an optimization we can look at later.
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.
+1