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

OPA doesn't consider built-in error fatal, but Conftest does. Can we revert the change? #870

Closed
ruokai-lai opened this issue Sep 20, 2023 · 1 comment · Fixed by #871
Closed
Labels
bug Something isn't working

Comments

@ruokai-lai
Copy link

Request:
OPA doesn't consider built-in error fatal, but Conftest does. Can we revert the change? Or make it print out builtin errors as opa with flag --show-builtin-errors.

In OPA, where it shows "built in errors are not fatal":
Run opa eval --help: you can see --show-builtin-errors collect and return all encountered built-in errors, built in errors are not fatal.

In Conftest, where it shows conftest fails with built in error:
introduced in version 0.42 https://github.com/open-policy-agent/conftest/blob/master/policy/engine.go#L449

if len(*builtInErrors) > 0 {
		return output.QueryResult{}, fmt.Errorf("built-in error: %s", (*builtInErrors))
}

Example of failure:
this will fail my conftest: https://play.openpolicyagent.org/p/wyU6iLcazl
and this will not fail my conftest: https://play.openpolicyagent.org/p/uk0FOQyNsO

@boranx
Copy link
Member

boranx commented Sep 20, 2023

I think it's fair to expect to have a similar user experience to OPA for builtin errors
to address that, I've moved the builtin errors behind a flag (--show-builtin-errors) in the PR: #871

@boranx boranx added the bug Something isn't working label Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants