diff --git a/main/404.html b/main/404.html index b4f24a025..11eb66351 100644 --- a/main/404.html +++ b/main/404.html @@ -1 +1 @@ -
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.
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. |
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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:
Cluster defines cluster config and context.
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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. | ||
jsonPath | JsonPath | JsonPath specifies the json path 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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). |
JsonPath
¶Appears in:
JsonPath represents parameters for waiting on a json path of a resource.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
path | string | Path defines the json path to wait for, e.g. '{.status.phase}'. | ||
value | string | Value defines the expected value to wait for, e.g., "Running". |
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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 | []TestStep | 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. |
TestStep
¶Appears in:
TestStep 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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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. | ||
cleanup | []Finally | Cleanup defines what will be executed after the test 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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). |
Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.
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. |
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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:
Cluster defines cluster config and context.
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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. | ||
jsonPath | JsonPath | JsonPath specifies the json path 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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). |
JsonPath
¶Appears in:
JsonPath represents parameters for waiting on a json path of a resource.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
path | string | Path defines the json path to wait for, e.g. '{.status.phase}'. | ||
value | string | Value defines the expected value to wait for, e.g., "Running". |
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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 | []TestStep | 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. |
TestStep
¶Appears in:
TestStep 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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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. | ||
cleanup | []Finally | Cleanup defines what will be executed after the test 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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
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). |
Package v1alpha2 contains API Schema definitions for the v1alpha2 API group.
Configuration
¶Configuration is the resource that contains the configuration used to run tests.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apiVersion | string | chainsaw.kyverno.io/v1alpha2 | ||
kind | string | Configuration | ||
metadata | meta/v1.ObjectMeta | Standard object's metadata. | ||
spec | ConfigurationSpec | Configuration spec. |
Cleanup
¶Appears in:
Cleanup contains the cleanup configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
skipDelete | bool | If set, do not delete the resources after running a test. | ||
delayBeforeCleanup | meta/v1.Duration | DelayBeforeCleanup adds a delay between the time a test ends and the time cleanup starts. |
ConfigurationSpec
¶Appears in:
ConfigurationSpec contains the configuration used to run tests.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
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. | ||
cleanup | Cleanup | Cleanup contains cleanup configuration. | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
discovery | Discovery | Discovery contains tests discovery configuration. | ||
execution | Execution | Execution contains tests execution configuration. | ||
namespace | Namespace | Namespace contains properties for the namespace to use for tests. | ||
report | Report | Report contains properties for the report. | ||
templating | Templating | Templating contains the templating config. | ||
timeouts | Timeouts | Global timeouts configuration. Applies to all tests/test steps if not overridden. |
Discovery
¶Appears in:
Discovery contains the tests discovery configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
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. | ||
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. | ||
fullName | bool | FullName makes use of the full test case folder path instead of the folder name. |
Execution
¶Appears in:
Execution contains the runner configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
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. | ||
repeatCount | int | RepeatCount indicates how many times the tests should be executed. | ||
forceTerminationGracePeriod | meta/v1.Duration | ForceTerminationGracePeriod forces the termination grace period on pods, statefulsets, daemonsets and deployments. |
Namespace
¶Appears in:
Namespace contains info about the namespace used for testing.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
name | string | Name 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. | ||
template | policy/v1alpha1.Any | Template defines a template to create the test namespace. |
Report
¶Appears in:
Report contains info about the report.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
format | ReportFormatType | ReportFormat determines test report format (JSON | ||
path | string | ReportPath defines the path. | ||
name | string | ReportName defines the name of report to create. It defaults to "chainsaw-report". |
ReportFormatType
¶(Alias of string
)
Appears in:
Templating
¶Appears in:
Templating contains the templating configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
enabled | bool | Enabled determines whether resources should be considered for templating. |
Package v1alpha2 contains API Schema definitions for the v1alpha2 API group.
Configuration
¶Configuration is the resource that contains the configuration used to run tests.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
apiVersion | string | chainsaw.kyverno.io/v1alpha2 | ||
kind | string | Configuration | ||
metadata | meta/v1.ObjectMeta | Standard object's metadata. | ||
spec | ConfigurationSpec | Configuration spec. |
Cleanup
¶Appears in:
Cleanup contains the cleanup configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
skipDelete | bool | If set, do not delete the resources after running a test. | ||
delayBeforeCleanup | meta/v1.Duration | DelayBeforeCleanup adds a delay between the time a test ends and the time cleanup starts. |
ConfigurationSpec
¶Appears in:
ConfigurationSpec contains the configuration used to run tests.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
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. | ||
cleanup | Cleanup | Cleanup contains cleanup configuration. | ||
clusters | map[string]Cluster | Clusters holds a registry to clusters to support multi-cluster tests. | ||
discovery | Discovery | Discovery contains tests discovery configuration. | ||
execution | Execution | Execution contains tests execution configuration. | ||
namespace | Namespace | Namespace contains properties for the namespace to use for tests. | ||
report | Report | Report contains properties for the report. | ||
templating | Templating | Templating contains the templating config. | ||
timeouts | Timeouts | Global timeouts configuration. Applies to all tests/test steps if not overridden. |
Discovery
¶Appears in:
Discovery contains the tests discovery configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
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. | ||
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. | ||
fullName | bool | FullName makes use of the full test case folder path instead of the folder name. |
Execution
¶Appears in:
Execution contains the runner configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
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. | ||
repeatCount | int | RepeatCount indicates how many times the tests should be executed. | ||
forceTerminationGracePeriod | meta/v1.Duration | ForceTerminationGracePeriod forces the termination grace period on pods, statefulsets, daemonsets and deployments. |
Namespace
¶Appears in:
Namespace contains info about the namespace used for testing.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
name | string | Name 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. | ||
template | policy/v1alpha1.Any | Template defines a template to create the test namespace. |
Report
¶Appears in:
Report contains info about the report.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
format | ReportFormatType | ReportFormat determines test report format (JSON | ||
path | string | ReportPath defines the path. | ||
name | string | ReportName defines the name of report to create. It defaults to "chainsaw-report". |
ReportFormatType
¶(Alias of string
)
Appears in:
Templating
¶Appears in:
Templating contains the templating configuration.
Field | Type | Required | Inline | Description |
---|---|---|---|---|
enabled | bool | Enabled determines whether resources should be considered for templating. |
Chainsaw has a concept of bindings
which can be seen as an execution context.
Bindings are used in assertion trees and resource templating, as well as when using the --values
flag when invoking chainsaw.
While some bindings are built-in and provided by chainsaw, it's possible to define custom bindings at the test, step, or individual operation level. Those bindings can in turn be used to create custom environment variables in command
and script
operations.
It's important to note that bindings are immutable, it's not possible to overwrite a binding and two bindings with the same name can exist without overwriting each other.
When a binding value is resolved, chainsaw will walk the binding chain upwards until it finds a binding with the expected name. Effectively, the last one registered in the chain will be used.
A binding name
supports templating.
The name of a binding can therefore be dynamic and depend on values or other bindings.
The example below defines custom bindings at the test level.
Test level bindings
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Bindings - Chainsaw Chainsaw Bindings
Bindings¶
Chainsaw has a concept of bindings
which can be seen as an execution context.
Bindings are used in assertion trees and resource templating, as well as when using the --values
flag when invoking chainsaw.
While some bindings are built-in and provided by chainsaw, it's possible to define custom bindings at the test, step, or individual operation level. Those bindings can in turn be used to create custom environment variables in command
and script
operations.
Immutability¶
It's important to note that bindings are immutable, it's not possible to overwrite a binding and two bindings with the same name can exist without overwriting each other.
When a binding value is resolved, chainsaw will walk the binding chain upwards until it finds a binding with the expected name. Effectively, the last one registered in the chain will be used.
Templating¶
A binding name
supports templating.
The name of a binding can therefore be dynamic and depend on values or other bindings.
Usage¶
The example below defines custom bindings at the test level.
Test level bindings
Outputs¶
Under certain conditions, bindings can also be used to add computed results to the context.
See Outputs for details.
\ No newline at end of file
+
Under certain conditions, bindings can also be used to add computed results to the context.
See Outputs for details.
Binding outputs can be useful to communicate and reuse computation results between operations.
Currently, only script
and command
operations support outputs.
Once an output has been added in the form of a binding, this binding will be available to all following operations in the same step.
Currently, outputs do not cross the step boundaries.
An output supports an optional match
field. The match
is used to conditionally create a binding.
In the case of applying a file, for example, the file may contain multiple resources. The match
can be used to select the resource to use for creating the binding.
The example below defines invokes a kubectl
command to get a configmap from the cluster in json format.
The json output is then parsed and added to the $cm
binding and the next operation performs an assertion on it by reading the binding instead of querying the cluster.
Output in script
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Outputs - Chainsaw Chainsaw Outputs
Outputs¶
Binding outputs can be useful to communicate and reuse computation results between operations.
Supported operations¶
Currently, only script
and command
operations support outputs.
Lifetime of outputs¶
Once an output has been added in the form of a binding, this binding will be available to all following operations in the same step.
Currently, outputs do not cross the step boundaries.
Matching¶
An output supports an optional match
field. The match
is used to conditionally create a binding.
In the case of applying a file, for example, the file may contain multiple resources. The match
can be used to select the resource to use for creating the binding.
Examples¶
The example below defines invokes a kubectl
command to get a configmap from the cluster in json format.
The json output is then parsed and added to the $cm
binding and the next operation performs an assertion on it by reading the binding instead of querying the cluster.
\ No newline at end of file
+
Describing resources present in the cluster can help understand what happened and troubleshoot test failures.
Reference documentation
Describe
resource is documented here.Deprecated syntax
You can specify the resource
directly instead of using apiVersion
and kind
.
This is a deprecated syntax though and will be removed in a future version.
When used with a clustered resource, the namespace
is ignored and is not added to the corresponding kubectl
command.
When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
If a name
is specified, Chainsaw will describe resources that have a name starting with the provided name
in the test namespace (or in the cluster if it is a clustered-level resource).
Describe pods in the test namespace
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Describe - Chainsaw Chainsaw Describe
Describe¶
Describing resources present in the cluster can help understand what happened and troubleshoot test failures.
Configuration¶
Reference documentation
- The full structure of the
Describe
resource is documented here.
Deprecated syntax
You can specify the resource
directly instead of using apiVersion
and kind
.
This is a deprecated syntax though and will be removed in a future version.
Clustered resources¶
When used with a clustered resource, the namespace
is ignored and is not added to the corresponding kubectl
command.
All namespaces¶
When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
Usage examples¶
Describe pods¶
If a name
is specified, Chainsaw will describe resources that have a name starting with the provided name
in the test namespace (or in the cluster if it is a clustered-level resource).
\ No newline at end of file
+
Collecting namespace events can help understand what happened inside the cluster.
Reference documentation
Events
resource is documented here.When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
If a name
is specified, Chainsaw will retrieve the specified event in the test namespace.
Collect event in the test namespace
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Events - Chainsaw Chainsaw Events
Events¶
Collecting namespace events can help understand what happened inside the cluster.
Configuration¶
Reference documentation
- The full structure of the
Events
resource is documented here.
All namespaces¶
When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
Usage examples¶
Single event¶
If a name
is specified, Chainsaw will retrieve the specified event in the test namespace.
\ No newline at end of file
+
The get
collector is used to list and print resources in the cluster.
Reference documentation
Get
resource is documented here.Deprecated syntax
You can specify the resource
directly instead of using apiVersion
and kind
.
This is a deprecated syntax though and will be removed in a future version.
When used with a clustered resource, the namespace
is ignored and is not added to the corresponding kubectl
command.
When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
If a name
is specified, Chainsaw will retrieve the specified resource in the test namespace.
Get pod in the test namespace
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Get - Chainsaw Chainsaw Get
Get¶
The get
collector is used to list and print resources in the cluster.
Configuration¶
Reference documentation
- The full structure of the
Get
resource is documented here.
Deprecated syntax
You can specify the resource
directly instead of using apiVersion
and kind
.
This is a deprecated syntax though and will be removed in a future version.
Clustered resources¶
When used with a clustered resource, the namespace
is ignored and is not added to the corresponding kubectl
command.
All namespaces¶
When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
Usage examples¶
Single resource¶
If a name
is specified, Chainsaw will retrieve the specified resource in the test namespace.
\ No newline at end of file
+
The purpose of collectors is to collect certain information about the outcome of a step should it fail (in the case of catch
) or at the end of the step (in the case of finally
).
The ultimate goal of collectors is to gather information about the failure of a step and therefore help understand what caused it to fail.
A test step can have an arbitrary number of collectors.
All string
fields in collectors support templating.
The purpose of collectors is to collect certain information about the outcome of a step should it fail (in the case of catch
) or at the end of the step (in the case of finally
).
The ultimate goal of collectors is to gather information about the failure of a step and therefore help understand what caused it to fail.
A test step can have an arbitrary number of collectors.
All string
fields in collectors support templating.
Collecting pod logs can help understand what happened inside one or more pods.
Reference documentation
PodLogs
resource is documented here.When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
If a pod name
is specified, Chainsaw will retrieve logs from this specific pod in the test namespace.
Collect pod logs in the test namespace
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Pod logs - Chainsaw Chainsaw Pod logs
Pod logs¶
Collecting pod logs can help understand what happened inside one or more pods.
Configuration¶
Reference documentation
- The full structure of the
PodLogs
resource is documented here.
All namespaces¶
When used with a namespaced resource, it is possible to consider all namespaces in the cluster by setting namespace: '*'
.
Usage examples¶
Single pod¶
If a pod name
is specified, Chainsaw will retrieve logs from this specific pod in the test namespace.
\ No newline at end of file
+
Stronger tool for e2e testing
chainsaw [flags]
+ Chainsaw - Chainsaw Chainsaw Chainsaw
Chainsaw
chainsaw¶
Stronger tool for e2e testing
Options¶
SEE ALSO¶
- chainsaw assert - Evaluate assertion
- chainsaw build - Build commands
- chainsaw completion - Generate the autocompletion script for the specified shell
- chainsaw create - Create Chainsaw resources
- chainsaw docs - Generate reference documentation
- chainsaw export - Export commands
- chainsaw lint - Lint a file or read from standard input
- chainsaw migrate - Migrate resources to Chainsaw
- chainsaw test - Run tests
- chainsaw version - Print the version informations
\ No newline at end of file
+
Evaluate assertion
chainsaw assert [flags] [FILE]
+ Chainsaw assert - Chainsaw Chainsaw Chainsaw assert
Chainsaw assert
chainsaw assert¶
Evaluate assertion
Options¶
--clustered Defines if the resource is clustered (only applies when resource is loaded from a file)
-f, --file string Path to the file to assert or '-' to read from stdin
-h, --help help for assert
@@ -25,4 +25,4 @@
--no-color Removes output colors
-r, --resource string Path to the file containing the resource
--timeout duration The assert timeout to use (default 30s)
-
SEE ALSO¶
- chainsaw - Stronger tool for e2e testing
\ No newline at end of file
+
Build commands
chainsaw build [flags]
+ Chainsaw build - Chainsaw Chainsaw Chainsaw build
Chainsaw build
chainsaw build¶
Build commands
Options¶
SEE ALSO¶
- chainsaw - Stronger tool for e2e testing
- chainsaw build docs - Build tests documentation
\ No newline at end of file
+
Build tests documentation
chainsaw build docs [flags]
+ Chainsaw build docs - Chainsaw Chainsaw Chainsaw build docs
Chainsaw build docs
chainsaw build docs¶
Build tests documentation
Options¶
--catalog string Path to the built test catalog file
-h, --help help for docs
--readme-file string Name of the built docs file (default "README.md")
--test-dir stringArray Directories containing test cases to run
--test-file string Name of the test file (default "chainsaw-test")
-
SEE ALSO¶
- chainsaw build - Build commands
\ No newline at end of file
+
Generate the autocompletion script for the specified shell
Generate the autocompletion script for chainsaw for the specified shell. See each sub-command's help for details on how to use the generated script.
Generate the autocompletion script for the specified shell
Generate the autocompletion script for chainsaw for the specified shell. See each sub-command's help for details on how to use the generated script.
Generate the autocompletion script for bash
Generate the autocompletion script for the bash shell.
This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.
To load completions in your current shell session:
source <(chainsaw completion bash)
+ Chainsaw completion bash - Chainsaw Chainsaw Chainsaw completion bash
Chainsaw completion bash
chainsaw completion bash¶
Generate the autocompletion script for bash
Synopsis¶
Generate the autocompletion script for the bash shell.
This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.
To load completions in your current shell session:
source <(chainsaw completion bash)
To load completions for every new session, execute once:
Linux:¶
chainsaw completion bash > /etc/bash_completion.d/chainsaw
macOS:¶
chainsaw completion bash > $(brew --prefix)/etc/bash_completion.d/chainsaw
You will need to start a new shell for this setup to take effect.
Options¶
SEE ALSO¶
- chainsaw completion - Generate the autocompletion script for the specified shell
\ No newline at end of file
+
Generate the autocompletion script for fish
Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
chainsaw completion fish | source
+ Chainsaw completion fish - Chainsaw Chainsaw Chainsaw completion fish
Chainsaw completion fish
chainsaw completion fish¶
Generate the autocompletion script for fish
Synopsis¶
Generate the autocompletion script for the fish shell.
To load completions in your current shell session:
chainsaw completion fish | source
To load completions for every new session, execute once:
chainsaw completion fish > ~/.config/fish/completions/chainsaw.fish
You will need to start a new shell for this setup to take effect.
Options¶
SEE ALSO¶
- chainsaw completion - Generate the autocompletion script for the specified shell
\ No newline at end of file
+
Generate the autocompletion script for powershell
Generate the autocompletion script for powershell.
To load completions in your current shell session:
chainsaw completion powershell | Out-String | Invoke-Expression
+ Chainsaw completion powershell - Chainsaw Chainsaw Chainsaw completion powershell
Chainsaw completion powershell
chainsaw completion powershell¶
Generate the autocompletion script for powershell
Synopsis¶
Generate the autocompletion script for powershell.
To load completions in your current shell session:
chainsaw completion powershell | Out-String | Invoke-Expression
To load completions for every new session, add the output of the above command to your powershell profile.
Options¶
SEE ALSO¶
- chainsaw completion - Generate the autocompletion script for the specified shell
\ No newline at end of file
+
Generate the autocompletion script for zsh
Generate the autocompletion script for the zsh shell.
If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrc
+ Chainsaw completion zsh - Chainsaw Chainsaw Chainsaw completion zsh
Chainsaw completion zsh
chainsaw completion zsh¶
Generate the autocompletion script for zsh
Synopsis¶
Generate the autocompletion script for the zsh shell.
If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
echo "autoload -U compinit; compinit" >> ~/.zshrc
To load completions in your current shell session:
source <(chainsaw completion zsh)
To load completions for every new session, execute once:
Linux:¶
chainsaw completion zsh > "${fpath[1]}/_chainsaw"
macOS:¶
chainsaw completion zsh > $(brew --prefix)/share/zsh/site-functions/_chainsaw
You will need to start a new shell for this setup to take effect.
Options¶
SEE ALSO¶
- chainsaw completion - Generate the autocompletion script for the specified shell
\ No newline at end of file
+
Create Chainsaw resources
chainsaw create [flags]
+ Chainsaw create - Chainsaw Chainsaw Chainsaw create
Chainsaw create
chainsaw create¶
Create Chainsaw resources
Options¶
SEE ALSO¶
- chainsaw - Stronger tool for e2e testing
- chainsaw create test - Create a Chainsaw test
\ No newline at end of file
+
Create a Chainsaw test
chainsaw create test [flags]
+ Chainsaw create test - Chainsaw Chainsaw Chainsaw create test
Chainsaw create test
chainsaw create test¶
Create a Chainsaw test
Options¶
--description If set, adds description when applicable (default true)
--force If set, existing test will be deleted if needed
-h, --help help for test
--save If set, created test will be saved
-
SEE ALSO¶
- chainsaw create - Create Chainsaw resources
\ No newline at end of file
+
Generate reference documentation
chainsaw docs [flags]
+ Chainsaw docs - Chainsaw Chainsaw Chainsaw docs
Chainsaw docs
chainsaw docs¶
Generate reference documentation
Options¶
--autogenTag Determines if the generated docs should contain a timestamp (default true)
-h, --help help for docs
-o, --output string Output path (default ".")
--website Website version
-
SEE ALSO¶
- chainsaw - Stronger tool for e2e testing
\ No newline at end of file
+
Export commands
chainsaw export [flags]
+ Chainsaw export - Chainsaw Chainsaw Chainsaw export
Chainsaw export
chainsaw export¶
Export commands
Options¶
SEE ALSO¶
- chainsaw - Stronger tool for e2e testing
- chainsaw export schemas - Export JSON schemas
\ No newline at end of file
+
Export JSON schemas
chainsaw export schemas [flags]
+ Chainsaw export schemas - Chainsaw Chainsaw Chainsaw export schemas
Chainsaw export schemas
chainsaw export schemas¶
Export JSON schemas
Options¶
SEE ALSO¶
- chainsaw export - Export commands
\ No newline at end of file
+
Lint a file or read from standard input
Use chainsaw lint to lint a specific file or read from standard input for either test or configuration.
chainsaw lint [test|configuration] [flags]
+ Chainsaw lint - Chainsaw Chainsaw Chainsaw lint
\ No newline at end of file
+
Migrate resources to Chainsaw
chainsaw migrate [flags]
+ Chainsaw migrate - Chainsaw Chainsaw Chainsaw migrate
Chainsaw migrate
chainsaw migrate¶
Migrate resources to Chainsaw
Options¶
SEE ALSO¶
- chainsaw - Stronger tool for e2e testing
- chainsaw migrate kuttl - Migrate KUTTL resources to Chainsaw
\ No newline at end of file
+
Migrate KUTTL resources to Chainsaw
chainsaw migrate kuttl [flags]
+ Chainsaw migrate kuttl - Chainsaw Chainsaw Chainsaw migrate kuttl
Chainsaw migrate kuttl
chainsaw migrate kuttl¶
Migrate KUTTL resources to Chainsaw
Options¶
SEE ALSO¶
- chainsaw migrate - Migrate resources to Chainsaw
- chainsaw migrate kuttl config - Migrate KUTTL config to Chainsaw
- chainsaw migrate kuttl tests - Migrate KUTTL tests to Chainsaw
\ No newline at end of file
+
Migrate KUTTL config to Chainsaw
chainsaw migrate kuttl config [flags]
+ Chainsaw migrate kuttl config - Chainsaw Chainsaw Chainsaw migrate kuttl config
Chainsaw migrate kuttl config
chainsaw migrate kuttl config¶
Migrate KUTTL config to Chainsaw
Options¶
--cleanup If set, delete converted files
-h, --help help for config
--save If set, converted files will be saved
-
SEE ALSO¶
- chainsaw migrate kuttl - Migrate KUTTL resources to Chainsaw
\ No newline at end of file
+
Migrate KUTTL tests to Chainsaw
chainsaw migrate kuttl tests [flags]
+ Chainsaw migrate kuttl tests - Chainsaw Chainsaw Chainsaw migrate kuttl tests
Chainsaw migrate kuttl tests
chainsaw migrate kuttl tests¶
Migrate KUTTL tests to Chainsaw
Options¶
--cleanup If set, delete converted files
-h, --help help for tests
--save If set, converted files will be saved
-
SEE ALSO¶
- chainsaw migrate kuttl - Migrate KUTTL resources to Chainsaw
\ No newline at end of file
+
Run tests
chainsaw test [flags]... [test directories]...
+ Chainsaw test - Chainsaw Chainsaw Chainsaw test
Chainsaw test
chainsaw test¶
Run tests
Options¶
--apply-timeout duration The apply timeout to use as default for configuration (default 5s)
--assert-timeout duration The assert timeout to use as default for configuration (default 30s)
--cleanup-delay duration Adds a delay between the time a test ends and the time cleanup starts
@@ -48,4 +48,4 @@
--test-dir strings Directories containing test cases to run
--test-file string Name of the test file (default "chainsaw-test")
--values strings Values passed to the tests
-
SEE ALSO¶
- chainsaw - Stronger tool for e2e testing
\ No newline at end of file
+
Chainsaw has a growing community and we would definitely love to see you join and contribute.
Everyone is welcome to make suggestions, report bugs, open feature requests, contribute code or docs, participate in discussions, write blogs or anything that can benefit the project.
Join our slack channel #kyverno-chainsaw to meet with users, contributors and maintainers.
To attend our community meetings, join the Chainsaw group. You will then be sent a meeting invite and will have access to the agenda and meeting notes. Any member may suggest topics for discussion.
This is a public, weekly for Kyverno-Chainsaw maintainers to make announcements and provide project updates, and request input and feedback. This forum allows community members to raise agenda items of any sort, including but not limited to any PRs or issues on which they are working.
Weekly every Thursday at 2:00 PM UTC
For detailed information on our planned features and upcoming updates, please view our Roadmap.
Please read the contributing guide for details around:
If you are using Chainsaw and want to share it publicly we always appreciate a bit of support. Pull requests to the ADOPTERS LIST will put a smile on our faces
Chainsaw has a growing community and we would definitely love to see you join and contribute.
Everyone is welcome to make suggestions, report bugs, open feature requests, contribute code or docs, participate in discussions, write blogs or anything that can benefit the project.
Join our slack channel #kyverno-chainsaw to meet with users, contributors and maintainers.
To attend our community meetings, join the Chainsaw group. You will then be sent a meeting invite and will have access to the agenda and meeting notes. Any member may suggest topics for discussion.
This is a public, weekly for Kyverno-Chainsaw maintainers to make announcements and provide project updates, and request input and feedback. This forum allows community members to raise agenda items of any sort, including but not limited to any PRs or issues on which they are working.
Weekly every Thursday at 2:00 PM UTC
For detailed information on our planned features and upcoming updates, please view our Roadmap.
Please read the contributing guide for details around:
If you are using Chainsaw and want to share it publicly we always appreciate a bit of support. Pull requests to the ADOPTERS LIST will put a smile on our faces
At the end of each test, Chainsaw will delete the resources it created during the test.
When testing operators, it can be useful to wait a little bit before starting the cleanup process to make sure the operator/controller has the necessary time to update the internal state.
For this reason, Chainsaw provides the delayBeforeCleanup
configuration option and the corresponding --delay-before-cleanup
flag.
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Delay before cleanup - Chainsaw Chainsaw Delay before cleanup
Delay before cleanup¶
At the end of each test, Chainsaw will delete the resources it created during the test.
When testing operators, it can be useful to wait a little bit before starting the cleanup process to make sure the operator/controller has the necessary time to update the internal state.
For this reason, Chainsaw provides the delayBeforeCleanup
configuration option and the corresponding --delay-before-cleanup
flag.
Configuration¶
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Configuration
metadata:
name: custom-config
@@ -7,4 +7,4 @@
delayBeforeCleanup: 5s
# ...
Flag¶
\ No newline at end of file
+
Chainsaw is described as a Stronger tool for e2e testing.
With its versatile configuration options, you can customize the testing process to fit your needs.
Chainsaw prioritizes its configuration in the following order:
User-specified configuration
If you explicitly provide a configuration file using a command-line flag
Default configuration file
If no configuration is specified, Chainsaw will look for a default file named .chainsaw.yaml
in the current working directory
Internal default configuration
In the absence of both the above, Chainsaw will use a default configuration file embedded in the Chainsaw binary
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Configuration file - Chainsaw Chainsaw Configuration file
Configuration file¶
Chainsaw is described as a Stronger tool for e2e testing.
With its versatile configuration options, you can customize the testing process to fit your needs.
Chainsaw prioritizes its configuration in the following order:
-
User-specified configuration
If you explicitly provide a configuration file using a command-line flag
-
Default configuration file
If no configuration is specified, Chainsaw will look for a default file named .chainsaw.yaml
in the current working directory
-
Internal default configuration
In the absence of both the above, Chainsaw will use a default configuration file embedded in the Chainsaw binary
Example¶
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Configuration
metadata:
name: custom-config
@@ -20,4 +20,4 @@
metadata:
name: default
spec: {}
-
Reference documentation¶
See Configuration API reference for more details.
\ No newline at end of file
+
See Configuration API reference for more details.
Even after a configuration file is loaded, you can override specific settings using command-line flags.
chainsaw test \
+ Command line flags - Chainsaw Chainsaw Command line flags
Command line flags¶
Even after a configuration file is loaded, you can override specific settings using command-line flags.
Example¶
chainsaw test \
path/to/test/dir \
--config path/to/your/config.yaml \
--assert-timeout 45s \
@@ -7,4 +7,4 @@
--parallel 4 \
...
In this example, Chainsaw will load a configuration file but the timeout configuration and other settings will be overridden by the values set in the flags, regardless of the value in the loaded configuration file.
Usage¶
The command below will run tests using the configuration from my-config.yaml
, taking tests from /path/to/tests
, and running a maximum of 10
tests simultaneously.
Reference documentation¶
See Chainsaw test command reference for more details.
\ No newline at end of file
+
See Chainsaw test command reference for more details.
Some Kubernetes resources can take time before being stopped. For example, deleting a Pod
can take time if the underlying container doesn't quit quickly enough.
For this reason, Chainsaw provides the forceTerminationGracePeriod
configuration option and the corresponding --force-termination-grace-period
flag. If set, Chainsaw will override the terminationGracePeriodSeconds
when working with the following resource kinds:
Pod
Deployment
StatefulSet
DaemonSet
Job
CronJob
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Termination graceful period - Chainsaw Chainsaw Termination graceful period
Termination graceful period¶
Some Kubernetes resources can take time before being stopped. For example, deleting a Pod
can take time if the underlying container doesn't quit quickly enough.
For this reason, Chainsaw provides the forceTerminationGracePeriod
configuration option and the corresponding --force-termination-grace-period
flag. If set, Chainsaw will override the terminationGracePeriodSeconds
when working with the following resource kinds:
Pod
Deployment
StatefulSet
DaemonSet
Job
CronJob
Configuration¶
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Configuration
metadata:
name: custom-config
@@ -7,4 +7,4 @@
forceTerminationGracePeriod: 5s
# ...
Flag¶
\ No newline at end of file
+
Chainsaw is a comprehensive tool designed to facilitate end-to-end testing in Kubernetes.
This documentation will focus on providing a breakdown of its configuration structure and how to use it.
Chainsaw can be configured in two different and complementary ways:
Precedence
If both are specified, command-line flags will take precedence over configuration coming from a configuration file.
Please pay attention to the configuration options below, they may or may not be relevant in your case but can be useful in certain cases:
Chainsaw is a comprehensive tool designed to facilitate end-to-end testing in Kubernetes.
This documentation will focus on providing a breakdown of its configuration structure and how to use it.
Chainsaw can be configured in two different and complementary ways:
Precedence
If both are specified, command-line flags will take precedence over configuration coming from a configuration file.
Please pay attention to the configuration options below, they may or may not be relevant in your case but can be useful in certain cases:
Chainsaw supports testing against multiple clusters.
To use a specific cluster in a test (or test step) you will need to register the cluster either using the config file or using command line flags.
Since v0.2.1
you can also register clusters dynamically at the test
, step
and operation levels. This is particularly useful when a cluster is created in a test step and used in subsequent steps.
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Multi cluster - Chainsaw Chainsaw Multi cluster
Multi cluster¶
Chainsaw supports testing against multiple clusters.
To use a specific cluster in a test (or test step) you will need to register the cluster either using the config file or using command line flags.
Since v0.2.1
you can also register clusters dynamically at the test
, step
and operation levels. This is particularly useful when a cluster is created in a test step and used in subsequent steps.
Configuration¶
Chainsaw can be run without connection to a Kubernetes cluster. In this case, chainsaw will not try to create an ephemeral namespace and all operations requiring a Kubernetes cluster will fail.
To run chainsaw in this mode pass the --no-cluster
flag.
# run chainsaw without connection to a Kubernetes cluster
+ Running without a cluster - Chainsaw Chainsaw Running without a cluster
\ No newline at end of file
+
Chainsaw can generate JUnit reports in XML
or JSON
format.
To produce a test report, configure the report format, report path and report name in the configuration or using CLI flags.
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Reports - Chainsaw Chainsaw Reports
Reports¶
Chainsaw can generate JUnit reports in XML
or JSON
format.
To produce a test report, configure the report format, report path and report name in the configuration or using CLI flags.
Configuration¶
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Configuration
metadata:
name: custom-config
@@ -9,4 +9,4 @@
reportPath: /home/chainsaw
# ...
Flag¶
chainsaw test --report-format JSON --report-name chainsaw-report --report-path /path/to/save/report ...
-
Note: The reportPath can be specified as either a relative or an absolute path.
\ No newline at end of file
+
Note: The reportPath can be specified as either a relative or an absolute path.
Chainsaw can filter the tests to run using label selectors.
You can pass label selectors using the --selector
flag when invoking the chainsaw test
command.
Given the test below:
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Label selectors - Chainsaw Chainsaw Label selectors
Label selectors¶
Chainsaw can filter the tests to run using label selectors.
You can pass label selectors using the --selector
flag when invoking the chainsaw test
command.
Example¶
Given the test below:
apiVersion: chainsaw.kyverno.io/v1alpha1
kind: Test
metadata:
name: basic
@@ -7,4 +7,4 @@
spec:
# ...
Invoking Chainsaw with the command below will take the test above into account:
\ No newline at end of file
+
Experimental status
This is an experimental feature, and implementation could change slightly in the next versions.
Info
Templating was disabled by default in v0.1.*
but is now enabled by default since v0.2.1
.
Chainsaw can apply transformations to the resources before they are processed by the operation.
This is useful when a resource needs some runtime configuration.
Templating must be enabled at the configuration, test, step, or operation level for the templating process to kick in. Alternatively, templating can be enabled using the --template
flag when invoking chainsaw from the command line.
Note
Unlike assertion trees, templating can only be specified in leave nodes of the YAML tree.
The test below will create, assert, and delete a ConfigMap
with a dynamic name
configured at runtime using the $namespace
binding.
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Resource templating - Chainsaw Chainsaw Resource templating
Resource templating¶
Experimental status
This is an experimental feature, and implementation could change slightly in the next versions.
Info
Templating was disabled by default in v0.1.*
but is now enabled by default since v0.2.1
.
Chainsaw can apply transformations to the resources before they are processed by the operation.
This is useful when a resource needs some runtime configuration.
Templating must be enabled at the configuration, test, step, or operation level for the templating process to kick in. Alternatively, templating can be enabled using the --template
flag when invoking chainsaw from the command line.
Note
Unlike assertion trees, templating can only be specified in leave nodes of the YAML tree.
Example¶
The test below will create, assert, and delete a ConfigMap
with a dynamic name
configured at runtime using the $namespace
binding.
\ No newline at end of file
+
Timeouts in Chainsaw are specified per type of operation. This is required because the timeout varies greatly depending on the nature of an operation.
For example, applying a manifest in a cluster is expected to be reasonably fast, while validating a resource can be a long operation.
Chainsaw supports separately configuring the timeouts below:
Apply
When Chainsaw applies manifests in a cluster
Assert
When Chainsaw validates resources in a cluster
Cleanup
When Chainsaw removes resources from a cluster created for a test
Delete
When Chainsaw deletes resources from a cluster
Error
When Chainsaw validates resources in a cluster
Exec
When Chainsaw executes arbitrary commands or scripts
Overriding timeouts
Each timeout can be overridden at the test level, test step level, or individual operation level.
Timeouts defined in the Configuration
are used in operations when not overridden.
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Timeouts - Chainsaw Chainsaw Timeouts
Timeouts¶
Timeouts in Chainsaw are specified per type of operation. This is required because the timeout varies greatly depending on the nature of an operation.
For example, applying a manifest in a cluster is expected to be reasonably fast, while validating a resource can be a long operation.
Chainsaw supports separately configuring the timeouts below:
-
Apply
When Chainsaw applies manifests in a cluster
-
Assert
When Chainsaw validates resources in a cluster
-
Cleanup
When Chainsaw removes resources from a cluster created for a test
-
Delete
When Chainsaw deletes resources from a cluster
-
Error
When Chainsaw validates resources in a cluster
-
Exec
When Chainsaw executes arbitrary commands or scripts
Overriding timeouts
Each timeout can be overridden at the test level, test step level, or individual operation level.
Timeouts defined in the Configuration
are used in operations when not overridden.
Configuration¶
\ No newline at end of file
+
Chainsaw can pass arbitrary values when running tests using the --values
flag. Values will be available to tests under the $values
binding.
This is useful when a test needs to be configured externally.
The test below expects the $value.foo
to be provided when chainsaw is invoked.
apiVersion: chainsaw.kyverno.io/v1alpha1
+ Passing data to tests - Chainsaw Chainsaw Passing data to tests
Passing data to tests¶
Chainsaw can pass arbitrary values when running tests using the --values
flag. Values will be available to tests under the $values
binding.
This is useful when a test needs to be configured externally.
Example¶
The test below expects the $value.foo
to be provided when chainsaw is invoked.
\ No newline at end of file
+
This example demonstrates how to perform complex assertions on arrays.
See Setup docs
resources.yaml
¶To use Chainsaw you will need a Kubernetes cluster, Chainsaw won't create one for you.
In these examples, we will use kind but feel free to use the tool of your choice.
Not a cluster management tool
We consider this is not the responsibility of Chainsaw to manage clusters.
There are plenty of solutions to create and manage local clusters that will do that better than Chainsaw.
Please refer to the kind install docs to install it locally.
Once kind creating a local cluster is as simple as running:
# define kind image
+ Examples - Chainsaw Chainsaw Examples
Examples¶
Setup¶
To use Chainsaw you will need a Kubernetes cluster, Chainsaw won't create one for you.
In these examples, we will use kind but feel free to use the tool of your choice.
Not a cluster management tool
We consider this is not the responsibility of Chainsaw to manage clusters.
There are plenty of solutions to create and manage local clusters that will do that better than Chainsaw.
Create a kind cluster¶
Please refer to the kind install docs to install it locally.
Once kind creating a local cluster is as simple as running:
# define kind image
export KIND_IMAGE="kindest/node:v1.28.0"
# create cluster
kind create cluster --image $KIND_IMAGE
-
Install Chainsaw¶
Refer to install docs to install Chainsaw.
\ No newline at end of file
+
Refer to install docs to install Chainsaw.
A GitHub action is available to easily install Chainsaw in your workflows.
The GitHub action is available at kyverno/action-install-chainsaw or in the marketplace.
This action currently supports GitHub-provided Linux, macOS and Windows runners (self-hosted runners may not work).
Add the following entry to your Github workflow YAML file:
uses: kyverno/action-install-chainsaw@v0.1.0
+ GitHub action - Chainsaw Chainsaw GitHub action
GitHub action¶
A GitHub action is available to easily install Chainsaw in your workflows.
The GitHub action is available at kyverno/action-install-chainsaw or in the marketplace.
Usage¶
This action currently supports GitHub-provided Linux, macOS and Windows runners (self-hosted runners may not work).
Add the following entry to your Github workflow YAML file:
Example using a pinned version:
Optional Inputs¶
The following optional inputs:
Input Description release
chainsaw
version to use instead of the default. install-dir
directory to place the chainsaw
binary into instead of the default ($HOME/.chainsaw
). use-sudo
set to true
if install-dir
location requires sudo privs. Defaults to false. verify
set to true
to enable cosign verification of the downloaded archive.
\ No newline at end of file
+
The following optional inputs:
Input | Description |
---|---|
release | chainsaw version to use instead of the default. |
install-dir | directory to place the chainsaw binary into instead of the default ($HOME/.chainsaw ). |
use-sudo | set to true if install-dir location requires sudo privs. Defaults to false. |
verify | set to true to enable cosign verification of the downloaded archive. |
Install locally using a package manager like brew or nix, or simply download the binary from one of our releases. If you want to run using a Docker image, we have that too.
Write tests in minutes, not hours. All it takes is a YAML file to define the steps of a test. Chainsaw will do the rest, no need to learn a programing language or write a single line of code!
Understand and diagnose failures easily, thanks to a comprehensive output showing precisely what failed and why. Generate JUnit compatible reports to integrate with other test reporting tools.
Kubernetes is all about resouces and tests need to work with resources. Chainsaw has built-in support for bindings, operation outputs and resource templating to describe complex test scenarios.
Focus on the software you are building, write test scenarios using YAML and let Chainsaw tell you what passes or not. Integrate in your CI pipeline to prevent regressions and release with better confidence.
Native support for tests involving multiple clusters, either static or dynamically created ones, make Chainsaw an excellent tool for testing highly complex environments and architectures.