mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
compile: Allow object generating rules to be annotated as entrypoint (#5578)
Using ground ref of rule when generating entrypoint from annotation as variable in head suffix cannot be included in generated entrypoint path. Fixes: #5577 Signed-off-by: Johan Fylling <johan.dev@fylling.se>
This commit is contained in:
+1
-1
@@ -234,7 +234,7 @@ func addEntrypointsFromAnnotations(c *Compiler, ar []*ast.AnnotationsRef) error
|
||||
}
|
||||
case "rule":
|
||||
if r := ref.GetRule(); r != nil {
|
||||
entrypoint = r.Ref()
|
||||
entrypoint = r.Ref().GroundPrefix()
|
||||
}
|
||||
default:
|
||||
continue // Wrong scope type. Bail out early.
|
||||
|
||||
Reference in New Issue
Block a user