You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
conftest to download the bundle.tar.gz file, unpack it, and then run the tests in the file.
What I observed
Error: running test: load: loading policies: no policies found in [policy]. I saw that the bundle.tar.gz file had been downloaded.
Notes
I also tried with conftest push -- I was expecting both processes to work the same way. However, when I inspected the registry itself, I saw very different file formats.
The manifest.json for the opa build . && oras push command shows that a single layer was pushed that contained the bundle.tar.gz layer. However, the manifest.json for the conftest push command shows that multiple layers were pushed, each layer containing a single .rego file.
What is the intended behaviour? The documentation mentions the format should reuse the OPA bundle format.
The text was updated successfully, but these errors were encountered:
in case they are in the form of 127.0.0.1:port or localhost
From a user experience point of view, as to how you'd store your policies and execute, I'd recommend using contest push
Because, it just takes the parameters as required so you don't have to manage compressing the layers as tarball and handle json files
The example format would be conftest push 127.0.0.1:5000/testpolicy path/to/policy-dir
We might wanna update the contest docs with local registry use cases for better visibility, any PRs are welcome if you have any cycles:)
What I tried:
opa build .
where.
is the location of my policiesoras push <oci registry uri> --config config.json:[...] bundle.tar.gz:[...]
as per the OPA documentation websiteconftest test --update <oci registry uri> my-file.yaml
Note that my oci registry is on an on-prem instance of artifactory. I'm not 100% sure, but https://github.com/open-policy-agent/conftest/blob/master/downloader/oci_detector.go#L33 uses a regex match on hostnames to determine whether it's a valid OCI registry, which would fail on my on-prem artifactory (since it doesn't use those hostnames).
What I expected
conftest to download the bundle.tar.gz file, unpack it, and then run the tests in the file.
What I observed
Error: running test: load: loading policies: no policies found in [policy]
. I saw that thebundle.tar.gz
file had been downloaded.Notes
I also tried with
conftest push
-- I was expecting both processes to work the same way. However, when I inspected the registry itself, I saw very different file formats.The
manifest.json
for theopa build . && oras push
command shows that a single layer was pushed that contained thebundle.tar.gz
layer. However, themanifest.json
for theconftest push
command shows that multiple layers were pushed, each layer containing a single.rego
file.What is the intended behaviour? The documentation mentions the format should reuse the OPA bundle format.
The text was updated successfully, but these errors were encountered: