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] Support http bundle loading shorthand #5674

Closed
charlieegan3 opened this issue Feb 20, 2023 · 1 comment · Fixed by #5675
Closed

[bundle] Support http bundle loading shorthand #5674

charlieegan3 opened this issue Feb 20, 2023 · 1 comment · Fixed by #5675

Comments

@charlieegan3
Copy link
Contributor

What is the underlying problem you're trying to solve?

I would like to be able to provide users with a quick way to start OPA with a remote bundle, e.g.

opa run -s https://example.com/bundle.tar.gz

Currently I must use a config file like this:

services:
  example:
    url: http://localhost:8080

bundles:
  example:
    service: example
    resource: bundle.tar.gz
    persist: true

Or use --set many times:

opa run -s --set=services.example.url=http://localhost:8080 --set bundles.example.resource="bundle.tar.gz" --set bundles.example.service="example" --set bundles.example.persist="true"

This would make it harder for users new to OPA to understand what's going on or to follow a tutorial.

Describe the ideal solution

Running a command like this:

opa run -s https://example.com/bundle.tar.gz

Would be a shorthand for:

services:
  example:
    url: http://localhost:8080

bundles:
  example:
    service: example
    resource: bundle.tar.gz
    persist: true

Describe a "Good Enough" solution

OPA could instead stash the file in a temp dir and load it from that. However, it'd be nice to be able to reuse the bundle loading configuration to access features such as persistence so that users can reuse downloaded bundles.

Additional Context

Related to: #5673

@srenatus
Copy link
Contributor

That shorthand would also be great for the playground. Much better than
image

@charlieegan3 charlieegan3 changed the title [bundles] Support http bundle loading shorthand [bundle] Support http bundle loading shorthand Feb 20, 2023
@anderseknert anderseknert self-assigned this Feb 21, 2023
anderseknert added a commit to anderseknert/opa that referenced this issue Feb 21, 2023
Fixes: open-policy-agent#5674

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit to anderseknert/opa that referenced this issue Feb 21, 2023
Fixes: open-policy-agent#5674

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue Feb 21, 2023
Fixes: #5674

Signed-off-by: Anders Eknert <anders@styra.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants