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

Commandline bundles omit 'revision' in decision logs. #1062

Closed
pwmorreale opened this issue Nov 8, 2018 · 1 comment
Closed

Commandline bundles omit 'revision' in decision logs. #1062

pwmorreale opened this issue Nov 8, 2018 · 1 comment
Labels

Comments

@pwmorreale
Copy link

If you add a policy bundle, with a .manifest defined, on the command line, the decision logs will not contain the contents of the .manifest 'revision' field.

@tsandall
Copy link
Member

tsandall commented Nov 9, 2018

When bundles are loaded from the command line the /system/bundle/manifest document is not being written into the in-memory store. For bundle downloads, this behaviour is implemented inside the bundle plugin. One way to resolve this would be add an optional flag on the bundle reader that would cause it to insert the bundle metadata into the bundle.Bundle#Data field. When bundles are instantiated in different places inside OPA, we could set the flag. If users are embedding OPA as a library, they could opt-in to this behaviour.

For example:

// Instead of the current simple API:
bundle.Read(r)

// Construct a reader and set the flag:
br := bundle.NewReader(r).IncludeManifestInData(true)
br.Read()

@tsandall tsandall added the bug label Nov 9, 2018
ashutosh-narkar added a commit to ashutosh-narkar/opa that referenced this issue Nov 26, 2018
Fixes open-policy-agent#1062

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
ashutosh-narkar added a commit that referenced this issue Nov 26, 2018
Fixes #1062

Signed-off-by: Ashutosh Narkar <anarkar4387@gmail.com>
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

2 participants