https://cerbos.dev logo
Title
d

Dmitry Meyerson

05/16/2023, 4:08 PM
have my basic set of policies - currently using the recommended docker-powered test approach to validate/test - ex:
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

Charith (Cerbos)

05/16/2023, 4:29 PM
Hi. That's odd. You should be able to put your policies in subdirectories. What's the error?
d

Dmitry Meyerson

05/16/2023, 4:30 PM
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

Charith (Cerbos)

05/16/2023, 4:32 PM
Ah, I think the issue is that you're mounting your
resources
subdirectory instead of
policies
. Try
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

Dmitry Meyerson

05/16/2023, 4:32 PM
OH
you are correct !
g

giphy

05/16/2023, 4:34 PM
disappear
c

Charith (Cerbos)

05/16/2023, 4:34 PM
🙂