You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe some of this is for prefixing bundle paths to make them unique between bundles (normally its using the actual bundle file name like authz.tar.gz or whatever) but it defaults to using the directory when loaded this way. What we might want to do is remove the leading slash, if possible, and try to avoid just repeating the directory base name (its kind of confusing to look at the id as-is).
The text was updated successfully, but these errors were encountered:
Previously if we provided a "root" to the bundle directory loader that
was a relative path, it would matter whether or not it was prefixed
with "./". The logic to trim that path from the paths found walking
the root was not taking into account the prefix so the resulting ones
that had "./" would leave behind the root path.
Later on the bundle loader would generate a "full" path to set on the
module file for its location which is the root+path.. which resulted
in duplicate "root"s on those id's.
To fix this we just normalize the relative paths in the directory
loader so that we can not worry about what type of relative path it
is.
Fixes: open-policy-agent#2117
Signed-off-by: Patrick East <east.patrick@gmail.com>
Previously if we provided a "root" to the bundle directory loader that
was a relative path, it would matter whether or not it was prefixed
with "./". The logic to trim that path from the paths found walking
the root was not taking into account the prefix so the resulting ones
that had "./" would leave behind the root path.
Later on the bundle loader would generate a "full" path to set on the
module file for its location which is the root+path.. which resulted
in duplicate "root"s on those id's.
To fix this we just normalize the relative paths in the directory
loader so that we can not worry about what type of relative path it
is.
Fixes: #2117
Signed-off-by: Patrick East <east.patrick@gmail.com>
If I have a bundle directory like:
When loaded like:
opa run -s -b ./policy
The policies show up with
id
's that are prefixed withpolicy
twice (and a leading/
which causes other problems... #2116 )Ex:
Additional Info
I believe some of this is for prefixing bundle paths to make them unique between bundles (normally its using the actual bundle file name like
authz.tar.gz
or whatever) but it defaults to using the directory when loaded this way. What we might want to do is remove the leading slash, if possible, and try to avoid just repeating the directory base name (its kind of confusing to look at the id as-is).The text was updated successfully, but these errors were encountered: