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

Handle overlap between package paths and rule names #137

Closed
tsandall opened this issue Nov 3, 2016 · 0 comments
Closed

Handle overlap between package paths and rule names #137

tsandall opened this issue Nov 3, 2016 · 0 comments
Labels

Comments

@tsandall
Copy link
Member

tsandall commented Nov 3, 2016

If a package path overlaps with a rule name (or vice versa), OPA should handle it better.

It seems reasonable to treat this kind of overlap as a conflict and reject at compile-time.

Simple example:

test1.rego...

package x

p = "hello"

test2.rego...

package x.p

q = "goodbye"

queries...

[venv/go](master)[*]torin:~/go/src/github.com/open-policy-agent/opa$ ./opa_darwin_amd64 run ~/test*
OPA 0.1.1-dev (commit b033f78-dirty, built at 2016-11-03T21:24:35Z)

Run 'help' to see a list of commands.

> data.x
{
  "p": "hello"
}
> data.x.p
"hello"
> data.x.p.q
"goodbye"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant