v1alpha1
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.
Resource Types¶
Configuration
¶
Configuration is the resource that contains the configuration used to run tests.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apiVersion | string | chainsaw.kyverno.io/v1alpha1 | ||
kind | string | Configuration | ||
metadata | meta/v1.ObjectMeta | Standard object's metadata. | ||
spec | ConfigurationSpec | Configuration spec. |
Test
¶
Test is the resource that contains a test definition.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apiVersion | string | chainsaw.kyverno.io/v1alpha1 | ||
kind | string | Test | ||
metadata | meta/v1.ObjectMeta | Standard object's metadata. | ||
spec | TestSpec | Test spec. |
TestStep
¶
TestStep is the resource that contains the testStep used to run tests.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apiVersion | string | chainsaw.kyverno.io/v1alpha1 | ||
kind | string | TestStep | ||
metadata | meta/v1.ObjectMeta | Standard object's metadata. | ||
spec | TestStepSpec | TestStep spec. |
Apply
¶
Appears in:
Apply represents a set of configurations or resources that should be applied during testing.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
outputs | []Output | Outputs defines output bindings. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
FileRefOrResource | FileRefOrResource | FileRefOrResource provides a reference to the resources to be applied. | ||
template | bool | Template determines whether resources should be considered for templating. | ||
dryRun | bool | DryRun determines whether the file should be applied in dry run mode. | ||
expect | []Expectation | Expect defines a list of matched checks to validate the operation outcome. |
Assert
¶
Appears in:
Assert represents a test condition that is expected to hold true during the testing process.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
FileRefOrCheck | FileRefOrCheck | FileRefOrAssert provides a reference to the assertion. | ||
template | bool | Template determines whether resources should be considered for templating. |
Binding
¶
Appears in:
Binding represents a key/value set as a binding in an executing test.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
name | string | Name the name of the binding. | ||
value | policy/v1alpha1.Any | Value value of the binding. |
Catch
¶
Appears in:
Catch defines actions to be executed on failure.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
description | string | Description contains a description of the operation. | ||
podLogs | PodLogs | PodLogs determines the pod logs collector to execute. | ||
events | Events | Events determines the events collector to execute. | ||
describe | Describe | Describe determines the resource describe collector to execute. | ||
wait | Wait | Wait determines the resource wait collector to execute. | ||
get | Get | Get determines the resource get collector to execute. | ||
delete | Delete | Delete represents a deletion operation. | ||
command | Command | Command defines a command to run. | ||
script | Script | Script defines a script to run. | ||
sleep | Sleep | Sleep defines zzzz. |
Cluster
¶
Appears in:
Field | Type | Required | Inline | Description |
---|---|---|---|---|
kubeconfig | string | Kubeconfig is the path to the referenced file. | ||
context | string | Context is the name of the context to use. |
Command
¶
Appears in:
Command describes a command to run as a part of a test step.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
outputs | []Output | Outputs defines output bindings. | ||
env | []Binding | Env defines additional environment variables. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
entrypoint | string | Entrypoint is the command entry point to run. | ||
args | []string | Args is the command arguments. | ||
skipLogOutput | bool | SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise. | ||
check | policy/v1alpha1.Any | Check is an assertion tree to validate the operation outcome. |
Condition
¶
Appears in:
Condition represents parameters for waiting on a specific condition of a resource.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
name | string | Name defines the specific condition to wait for, e.g., "Available", "Ready". | ||
value | string | Value defines the specific condition status to wait for, e.g., "True", "False". |
ConfigurationSpec
¶
Appears in:
ConfigurationSpec contains the configuration used to run tests.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeouts | Timeouts | Global timeouts configuration. Applies to all tests/test steps if not overridden. | ||
skipDelete | bool | If set, do not delete the resources after running the tests (implies SkipClusterDelete). | ||
template | bool | Template determines whether resources should be considered for templating. | ||
failFast | bool | FailFast determines whether the test should stop upon encountering the first failure. | ||
parallel | int | The maximum number of tests to run at once. | ||
reportFormat | ReportFormatType | ReportFormat determines test report format (JSON | ||
reportPath | string | ReportPath defines the path. | ||
reportName | string | ReportName defines the name of report to create. It defaults to "chainsaw-report". | ||
namespace | string | Namespace defines the namespace to use for tests. If not specified, every test will execute in a random ephemeral namespace unless the namespace is overridden in a the test spec. | ||
namespaceTemplate | policy/v1alpha1.Any | NamespaceTemplate defines a template to create the test namespace. | ||
fullName | bool | FullName makes use of the full test case folder path instead of the folder name. | ||
excludeTestRegex | string | ExcludeTestRegex is used to exclude tests based on a regular expression. | ||
includeTestRegex | string | IncludeTestRegex is used to include tests based on a regular expression. | ||
repeatCount | int | RepeatCount indicates how many times the tests should be executed. | ||
testFile | string | TestFile is the name of the file containing the test to run. If no extension is provided, chainsaw will try with .yaml first and .yml if needed. | ||
forceTerminationGracePeriod | meta/v1.Duration | ForceTerminationGracePeriod forces the termination grace period on pods, statefulsets, daemonsets and deployments. | ||
delayBeforeCleanup | meta/v1.Duration | DelayBeforeCleanup adds a delay between the time a test ends and the time cleanup starts. | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
catch | []Catch | Catch defines what the tests steps will execute when an error happens. This will be combined with catch handlers defined at the test and step levels. |
Create
¶
Appears in:
Create represents a set of resources that should be created. If a resource already exists in the cluster it will fail.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
outputs | []Output | Outputs defines output bindings. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
FileRefOrResource | FileRefOrResource | FileRefOrResource provides a reference to the file containing the resources to be created. | ||
template | bool | Template determines whether resources should be considered for templating. | ||
dryRun | bool | DryRun determines whether the file should be applied in dry run mode. | ||
expect | []Expectation | Expect defines a list of matched checks to validate the operation outcome. |
Delete
¶
Appears in:
Delete is a reference to an object that should be deleted
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
template | bool | Template determines whether resources should be considered for templating. | ||
ref | ObjectReference | ObjectReference determines objects to be deleted. | ||
expect | []Expectation | Expect defines a list of matched checks to validate the operation outcome. |
Deletion
¶
Appears in:
Deletion represents parameters for waiting on a resource's deletion.
Describe
¶
Appears in:
Describe defines how to describe resources.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
ResourceReference | ResourceReference | ResourceReference referenced resource type. | ||
ObjectLabelsSelector | ObjectLabelsSelector | ObjectLabelsSelector determines the selection process of referenced objects. | ||
showEvents | bool | Show Events indicates whether to include related events. |
Error
¶
Appears in:
Error represents an anticipated error condition that may arise during testing. Instead of treating such an error as a test failure, it acknowledges it as expected.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
FileRefOrCheck | FileRefOrCheck | FileRefOrAssert provides a reference to the expected error. | ||
template | bool | Template determines whether resources should be considered for templating. |
Events
¶
Appears in:
Events defines how to collect events.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
ObjectLabelsSelector | ObjectLabelsSelector | ObjectLabelsSelector determines the selection process of referenced objects. | ||
format | Format | Format determines the output format (json or yaml). |
Expectation
¶
Appears in:
Expectation represents a check to be applied on the result of an operation with a match filter to determine if the verification should be considered.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
match | policy/v1alpha1.Any | Match defines the matching statement. | ||
check | policy/v1alpha1.Any | Check defines the verification statement. |
FileRef
¶
Appears in:
FileRef represents a file reference.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
file | string | File is the path to the referenced file. This can be a direct path to a file or an expression that matches multiple files, such as "manifest/*.yaml" for all YAML files within the "manifest" directory. |
FileRefOrCheck
¶
Appears in:
FileRefOrCheck represents a file reference or resource.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
FileRef | FileRef | FileRef provides a reference to the file containing the resources to be applied. | ||
resource | policy/v1alpha1.Any | Check provides a check used in assertions. |
FileRefOrResource
¶
Appears in:
FileRefOrResource represents a file reference or resource.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
FileRef | FileRef | FileRef provides a reference to the file containing the resources to be applied. | ||
resource | meta/v1/unstructured.Unstructured | Resource provides a resource to be applied. |
Finally
¶
Appears in:
Finally defines actions to be executed at the end of a test.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
description | string | Description contains a description of the operation. | ||
podLogs | PodLogs | PodLogs determines the pod logs collector to execute. | ||
events | Events | Events determines the events collector to execute. | ||
describe | Describe | Describe determines the resource describe collector to execute. | ||
wait | Wait | Wait determines the resource wait collector to execute. | ||
get | Get | Get determines the resource get collector to execute. | ||
delete | Delete | Delete represents a deletion operation. | ||
command | Command | Command defines a command to run. | ||
script | Script | Script defines a script to run. | ||
sleep | Sleep | Sleep defines zzzz. |
For
¶
Appears in:
For specifies the condition to wait for.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
deletion | Deletion | Deletion specifies parameters for waiting on a resource's deletion. | ||
condition | Condition | Condition specifies the condition to wait for. |
Format
¶
(Alias of string
)
Appears in:
Format determines the output format (json or yaml).
Get
¶
Appears in:
Get defines how to get resources.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
ResourceReference | ResourceReference | ResourceReference referenced resource type. | ||
ObjectLabelsSelector | ObjectLabelsSelector | ObjectLabelsSelector determines the selection process of referenced objects. | ||
format | Format | Format determines the output format (json or yaml). |
ObjectLabelsSelector
¶
Appears in:
ObjectLabelsSelector represents a strategy to select objects. For a single object name and namespace are used to identify the object. For multiple objects use selector.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
namespace | string | Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ | ||
name | string | Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
selector | string | Selector defines labels selector. |
ObjectReference
¶
Appears in:
ObjectReference represents one or more objects with a specific apiVersion and kind. For a single object name and namespace are used to identify the object. For multiple objects use labels.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
ObjectType | ObjectType | ObjectType determines the type of referenced objects. | ||
ObjectSelector | ObjectSelector | ObjectSelector determines the selection process of referenced objects. |
ObjectSelector
¶
Appears in:
ObjectSelector represents a strategy to select objects. For a single object name and namespace are used to identify the object. For multiple objects use labels.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
namespace | string | Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ | ||
name | string | Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names | ||
labels | map[string]string | Label selector to match objects to delete |
ObjectType
¶
Appears in:
ObjectType represents a specific apiVersion and kind.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apiVersion | string | API version of the referent. | ||
kind | string | Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds |
Operation
¶
Appears in:
Operation defines a single operation, only one action is permitted for a given operation.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
description | string | Description contains a description of the operation. | ||
continueOnError | bool | ContinueOnError determines whether a test should continue or not in case the operation was not successful. Even if the test continues executing, it will still be reported as failed. | ||
apply | Apply | Apply represents resources that should be applied for this test step. This can include things like configuration settings or any other resources that need to be available during the test. | ||
assert | Assert | Assert represents an assertion to be made. It checks whether the conditions specified in the assertion hold true. | ||
command | Command | Command defines a command to run. | ||
create | Create | Create represents a creation operation. | ||
delete | Delete | Delete represents a deletion operation. | ||
error | Error | Error represents the expected errors for this test step. If any of these errors occur, the test will consider them as expected; otherwise, they will be treated as test failures. | ||
patch | Patch | Patch represents a patch operation. | ||
script | Script | Script defines a script to run. | ||
sleep | Sleep | Sleep defines zzzz. | ||
update | Update | Update represents an update operation. | ||
wait | Wait | Wait determines the resource wait collector to execute. |
Output
¶
Appears in:
Output represents an output binding with a match to determine if the binding must be considered or not.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
Binding | Binding | Binding determines the binding to create when the match succeeds. | ||
match | policy/v1alpha1.Any | Match defines the matching statement. |
Patch
¶
Appears in:
Patch represents a set of resources that should be patched. If a resource doesn't exist yet in the cluster it will fail.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
outputs | []Output | Outputs defines output bindings. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
FileRefOrResource | FileRefOrResource | FileRefOrResource provides a reference to the file containing the resources to be patched. | ||
template | bool | Template determines whether resources should be considered for templating. | ||
dryRun | bool | DryRun determines whether the file should be applied in dry run mode. | ||
expect | []Expectation | Expect defines a list of matched checks to validate the operation outcome. |
PodLogs
¶
Appears in:
PodLogs defines how to collect pod logs.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
ObjectLabelsSelector | ObjectLabelsSelector | ObjectLabelsSelector determines the selection process of referenced objects. | ||
container | string | Container in pod to get logs from else --all-containers is used. | ||
tail | int | Tail is the number of last lines to collect from pods. If omitted or zero, then the default is 10 if you use a selector, or -1 (all) if you use a pod name. This matches default behavior of |
ReportFormatType
¶
(Alias of string
)
Appears in:
ResourceReference
¶
Appears in:
ResourceReference represents a resource (API), it can be represented with a resource or a kind. Optionally an apiVersion can be specified.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apiVersion | string | API version of the referent. | ||
kind | string | Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds | ||
resource | string | Resource name of the referent. |
Script
¶
Appears in:
Script describes a script to run as a part of a test step.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
outputs | []Output | Outputs defines output bindings. | ||
env | []Binding | Env defines additional environment variables. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
content | string | Content defines a shell script (run with "sh -c ..."). | ||
skipLogOutput | bool | SkipLogOutput removes the output from the command. Useful for sensitive logs or to reduce noise. | ||
check | policy/v1alpha1.Any | Check is an assertion tree to validate the operation outcome. |
Sleep
¶
Appears in:
Sleep represents a duration while nothing happens.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
duration | meta/v1.Duration | Duration is the delay used for sleeping. |
TestSpec
¶
Appears in:
TestSpec contains the test spec.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
description | string | Description contains a description of the test. | ||
timeouts | Timeouts | Timeouts for the test. Overrides the global timeouts set in the Configuration on a per operation basis. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
skip | bool | Skip determines whether the test should skipped. | ||
concurrent | bool | Concurrent determines whether the test should run concurrently with other tests. | ||
skipDelete | bool | SkipDelete determines whether the resources created by the test should be deleted after the test is executed. | ||
template | bool | Template determines whether resources should be considered for templating. | ||
namespace | string | Namespace determines whether the test should run in a random ephemeral namespace or not. | ||
namespaceTemplate | policy/v1alpha1.Any | NamespaceTemplate defines a template to create the test namespace. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
steps | []TestSpecStep | Steps defining the test. | ||
catch | []Catch | Catch defines what the steps will execute when an error happens. This will be combined with catch handlers defined at the step level. | ||
forceTerminationGracePeriod | meta/v1.Duration | ForceTerminationGracePeriod forces the termination grace period on pods, statefulsets, daemonsets and deployments. | ||
delayBeforeCleanup | meta/v1.Duration | DelayBeforeCleanup adds a delay between the time a test ends and the time cleanup starts. |
TestSpecStep
¶
Appears in:
TestSpecStep contains the test step definition used in a test spec.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
name | string | Name of the step. | ||
TestStepSpec | TestStepSpec | TestStepSpec of the step. |
TestStepSpec
¶
Appears in:
TestStepSpec defines the desired state and behavior for each test step.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
description | string | Description contains a description of the test step. | ||
timeouts | Timeouts | Timeouts for the test step. Overrides the global timeouts set in the Configuration and the timeouts eventually set in the Test. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
skipDelete | bool | SkipDelete determines whether the resources created by the step should be deleted after the test step is executed. | ||
template | bool | Template determines whether resources should be considered for templating. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
try | []Operation | Try defines what the step will try to execute. | ||
catch | []Catch | Catch defines what the step will execute when an error happens. | ||
finally | []Finally | Finally defines what the step will execute after the step is terminated. |
Timeouts
¶
Appears in:
Timeouts contains timeouts per operation.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apply | meta/v1.Duration | Apply defines the timeout for the apply operation | ||
assert | meta/v1.Duration | Assert defines the timeout for the assert operation | ||
cleanup | meta/v1.Duration | Cleanup defines the timeout for the cleanup operation | ||
delete | meta/v1.Duration | Delete defines the timeout for the delete operation | ||
error | meta/v1.Duration | Error defines the timeout for the error operation | ||
exec | meta/v1.Duration | Exec defines the timeout for exec operations |
Update
¶
Appears in:
Update represents a set of resources that should be updated. If a resource does not exist in the cluster it will fail.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Overrides the global timeout set in the Configuration. | ||
bindings | []Binding | Bindings defines additional binding key/values. | ||
outputs | []Output | Outputs defines output bindings. | ||
cluster | string | Cluster defines the target cluster (default cluster will be used if not specified and/or overridden). | ||
FileRefOrResource | FileRefOrResource | FileRefOrResource provides a reference to the file containing the resources to be created. | ||
template | bool | Template determines whether resources should be considered for templating. | ||
dryRun | bool | DryRun determines whether the file should be applied in dry run mode. | ||
expect | []Expectation | Expect defines a list of matched checks to validate the operation outcome. |
Wait
¶
Appears in:
Wait specifies how to perform wait operations on resources.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
timeout | meta/v1.Duration | Timeout for the operation. Specifies how long to wait for the condition to be met before timing out. | ||
cluster | string | Cluster defines the target cluster where the wait operation will be performed (default cluster will be used if not specified). | ||
ResourceReference | ResourceReference | ResourceReference referenced resource type. | ||
ObjectLabelsSelector | ObjectLabelsSelector | ObjectLabelsSelector determines the selection process of referenced objects. | ||
for | For | For specifies the condition to wait for. | ||
format | Format | Format determines the output format (json or yaml). |