Skip to content

Commit

Permalink
feat: add Volumes/VolumeMounts/Setup to TestWorkflows (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
rangoo94 authored Mar 12, 2024
1 parent 6625e24 commit c5c7958
Show file tree
Hide file tree
Showing 8 changed files with 3,852 additions and 5 deletions.
10 changes: 10 additions & 0 deletions api/testworkflows/v1/step_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ type StepBase struct {
type IndependentStep struct {
StepBase `json:",inline" expr:"include"`

// steps to run before other operations in this step
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
Setup []IndependentStep `json:"setup,omitempty" expr:"include"`

// sub-steps to run
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
Expand All @@ -77,6 +82,11 @@ type Step struct {
// single template to run in this step
Template *TemplateRef `json:"template,omitempty" expr:"include"`

// steps to run before other operations in this step
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
Setup []Step `json:"setup,omitempty" expr:"include"`

// sub-steps to run
// +kubebuilder:pruning:PreserveUnknownFields
// +kubebuilder:validation:Schemaless
Expand Down
6 changes: 6 additions & 0 deletions api/testworkflows/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ type ContainerConfig struct {

// security context for the container
SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty" expr:"force"`

// volume mounts to append to the container
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty" expr:"force"`
}

type Resources struct {
Expand Down Expand Up @@ -65,4 +68,7 @@ type PodConfig struct {

// annotations added to the scheduled pod
Annotations map[string]string `json:"annotations,omitempty" expr:"template,template"`

// volumes to include in the pod
Volumes []corev1.Volume `json:"volumes,omitempty" expr:"force"`
}
28 changes: 28 additions & 0 deletions api/testworkflows/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions config/crd/bases/tests.testkube.io_testexecutions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ spec:
type: object
type: object
sourceScripts:
description: run scripts using source command (container executor only)
description: run scripts using source command (container executor
only)
type: boolean
sync:
description: whether to start execution sync or async
Expand Down Expand Up @@ -728,7 +729,8 @@ spec:
type: object
type: object
sourceScripts:
description: run scripts using source command (container executor only)
description: run scripts using source command (container executor
only)
type: boolean
startTime:
description: test start time
Expand Down
3 changes: 2 additions & 1 deletion config/crd/bases/tests.testkube.io_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,8 @@ spec:
type: object
type: object
sourceScripts:
description: run scripts using source command (container executor only)
description: run scripts using source command (container executor
only)
type: boolean
sync:
description: whether to start execution sync or async
Expand Down
6 changes: 4 additions & 2 deletions config/crd/bases/tests.testkube.io_testsuiteexecutions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,8 @@ spec:
type: object
type: object
sourceScripts:
description: run scripts using source command (container executor only)
description: run scripts using source command
(container executor only)
type: boolean
startTime:
description: test start time
Expand Down Expand Up @@ -1167,7 +1168,8 @@ spec:
type: object
type: object
sourceScripts:
description: run scripts using source command (container executor only)
description: run scripts using source command (container
executor only)
type: boolean
startTime:
description: test start time
Expand Down
Loading

0 comments on commit c5c7958

Please sign in to comment.