conftest
Last updated
Last updated
This provider allows you to validate your configuration files against policies that you specify, using the and Open Policy Agent rego query files. The provider creates Test action types of the same name, which allow you to specify files to validate.
Note that, in many cases, you'll actually want to use more specific providers that can automatically configure your conftest
actions, e.g. the and/or providers. See the for a simple usage example of the latter.
If those don't match your needs, you can use this provider directly and manually configure your conftest
actions. Simply add this provider to your project configuration, and see the for a detailed reference. Also, check out the below reference for how to configure default policies, default namespaces, and test failure thresholds for all conftest
actions.
Below is the full schema reference for the provider configuration. For an introduction to configuring a Garden project with providers, please look at our .
The reference is divided into two sections. The contains the complete YAML schema, and the describes each schema key.
The values in the schema below are the default values.
providers[]
providers[].name
The name of the provider plugin to use.
Example:
providers[].dependencies[]
List other providers that should be resolved before this one.
Example:
providers[].environments[]
If specified, this provider will only be used in the listed environments. Note that an empty array effectively disables the provider. To use a provider in all environments, omit this field.
Example:
providers[].policyPath
Path to the default policy directory or rego file to use for conftest
actions.
providers[].namespace
Default policy namespace to use for conftest
actions.
providers[].testFailureThreshold
Set this to "warn"
if you'd like tests to be marked as failed if one or more warn rules are matched. Set to "none"
to always mark the tests as successful.
Type | Default | Required |
---|
> name
Type | Required |
---|
> dependencies
Type | Default | Required |
---|
> environments
Type | Required |
---|
> policyPath
Type | Default | Required |
---|
> namespace
Type | Required |
---|
> testFailureThreshold
Type | Default | Required |
---|
|
| No |
| Yes |
|
| No |
| No |
|
| No |
| No |
|
| No |