Skip to content

Store UpsertPolicy not working as anticipated #318

Discussion options

You must be logged in to vote

Hi @yair12, thanks for sharing this use case and detailed write up. I can see what you are trying to do here and why the result is unexpected.

The reason that this is happening is that the upserted policy is only parsed when there are also a list of modules supplied. Until the module is parsed, it is unavailable for queries.

I believe the problematic logic can be found here:
https://github.com/open-policy-agent/opa/blob/9bd1bfb4e1440009be1e8d1a126d35d091d7f043/rego/rego.go#L1683-L1685

I have raised an issue for this here and will report back once I've asked some of the others on my team.

Thanks again for the detailed report :)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by yair12
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants