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

Bundle discovery issue when roots contains a space character #6704

Open
sirpi opened this issue Apr 19, 2024 · 0 comments
Open

Bundle discovery issue when roots contains a space character #6704

sirpi opened this issue Apr 19, 2024 · 0 comments

Comments

@sirpi
Copy link

sirpi commented Apr 19, 2024

Short description

I noticed a strange behavior when the agent is configured with bundle discovery, and one of the manifest roots contains space characters. In this case the bundle is loaded without any error, but the data content will be missing.

Example .manifest file:
{ "revision": "abc", "roots": ["a/b/foo bar"] }

Corresponding folder structure:

a
  b
    foo bar
      data.json
.manifest
.signatures.json

After loading this bundle via discovery and call GET http://localhost:8182/v1/data, the result does not contain the content of the data.json file, even the root (a.b.foo bar) is missing from the json tree. In the agent log the "Bundle loaded and activated successfully. Etag updated to ..." message appears.

This behaviour does not block loading other bundles though.

I could reproduce this even with the latest 0.63.0 version.

And to make the things more interesting, loading the same bundle from command line:
opa -s -b mybundle.tar.gz will load the bundle correctly.

Also, I changed "foo bar" to "foo%20bar" and this oddity still occurred (and obviously foo_bar fixed the issue).

Steps To Reproduce

Create an agent with a discovery config and add the above bundle to load.

Expected behavior

The json tree should reflect the data.json content even when the root contains a whitespace character.

@sirpi sirpi added the bug label Apr 19, 2024
@ashutosh-narkar ashutosh-narkar added this to Backlog in Open Policy Agent via automation Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Open Policy Agent
  
Backlog
Development

No branches or pull requests

1 participant