have my basic set of policies - currently using th...
# help
d
have my basic set of policies - currently using the recommended docker-powered test approach to validate/test - ex:
Copy code
docker run -i -t -v /path/to/policy/dir:/policies <http://ghcr.io/cerbos/cerbos:0.26.0|ghcr.io/cerbos/cerbos:0.26.0> compile /policies
however I notice that I have to place all of my resources in a single flat directory structure , so I get a role import error w/in my resourcePolicy doc when I try to keep thing tidy w/ /policies/derivedRoles and /policies/resources - whats the quick fix here? Thank you Cerbos - sorry for @ing ppl
c
Hi. That's odd. You should be able to put your policies in subdirectories. What's the error?
d
Copy code
docker run -i -t -v /path/on/host/policies/resources/:/policies <http://ghcr.io/cerbos/cerbos:0.26.0|ghcr.io/cerbos/cerbos:0.26.0> compile /policies
Missing Imports
admin.yaml: Import 'admin_roles' not found
config.yaml: Import 'common_roles_based_on_locale_and_groups' not found
A.yaml: Import 'common_roles_based_on_locale_and_groups' not found
B.yaml: Import 'common_roles_based_on_locale_and_groups' not found
c
Ah, I think the issue is that you're mounting your
resources
subdirectory instead of
policies
. Try
Copy code
docker run -i -t -v /path/on/host/policies/:/policies <http://ghcr.io/cerbos/cerbos:0.26.0|ghcr.io/cerbos/cerbos:0.26.0> compile /policies
d
OH
you are correct !
g
disappear
c
🙂