opa icon indicating copy to clipboard operation
opa copied to clipboard

OPA exec with bundle does not work on windows

Open peterchenadded opened this issue 2 years ago • 2 comments

Short description

Getting error on OPA exec when running command on windows that works on linux/mac.

OPA version: 0.40.0

Steps To Reproduce

  1. Run below command
opa_windows_amd64.exe exec --format=pretty --bundle ../test/rego/ path_to_json_folder

The error we get on windows

{"err":"runtime error: invalid URL for bundle \"~0\": parse \"file://C:\\\\repos\\\\test\\\\rego\": invalid port \":\\\\repos\\\\test\\\\rego\" after host","level":"error","msg":"Unexpected error.","time":"2022-09-14T11:06:43+10:00"}

Issues seems to be that it doesn't like the second : and treating it as port. the double escaping also doesn't help.

Expected behavior

It should report on the results and not error out.

Additional context

Working on linux/mac without issues.

If we run below command it works

opa_windows_amd64.exe exec --format=pretty --set bundles.test.resource=file://c:/repos/test/rego/ path_to_json_folder

peterchenadded avatar Sep 14 '22 07:09 peterchenadded

Hey there, thanks for the report. That version is pretty old, could you please try the same with 0.44.0, by any chance?

srenatus avatar Sep 15 '22 09:09 srenatus

Sure, pretty sure the issue exists in the latest version when I looked at the code. Will do an actual check and get back.

peterchenadded avatar Sep 15 '22 22:09 peterchenadded

This issue still exists with 0.44.0

dwheaton-paloit avatar Oct 05 '22 01:10 dwheaton-paloit