Skip to content

Commit

Permalink
feat: add options to control Test Workflow' containers isolation (#293)
Browse files Browse the repository at this point in the history
* feat: add options to control Test Workflow' containers isolation
* fix: make TestWorkflowSystem variables optional
  • Loading branch information
rangoo94 authored Aug 8, 2024
1 parent 1acead3 commit 1bfae78
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
11 changes: 11 additions & 0 deletions api/testworkflows/v1/base_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ type TestWorkflowSpecBase struct {
// events triggering execution of the test workflow
Events []Event `json:"events,omitempty" expr:"include"`

// system configuration to define the orchestration behavior
System *TestWorkflowSystem `json:"system,omitempty" expr:"include"`

// make the instance configurable with some input data for scheduling it
Config map[string]ParameterSchema `json:"config,omitempty" expr:"include"`

Expand All @@ -25,3 +28,11 @@ type TestWorkflowSpecBase struct {
// Deprecated: field is not used
Notifications *NotificationsConfig `json:"notifications,omitempty" expr:"include"`
}

type TestWorkflowSystem struct {
// assume all the steps are pure by default
PureByDefault *bool `json:"pureByDefault,omitempty"`

// disable the behavior of merging multiple operations in a single container
IsolatedContainers *bool `json:"isolatedContainers,omitempty"`
}
3 changes: 3 additions & 0 deletions api/testworkflows/v1/step_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type StepMeta struct {
// expression to declare under which conditions the step should be run
// defaults to: "passed", except artifacts where it defaults to "always"
Condition string `json:"condition,omitempty" expr:"expression"`

// mark the step as pure, applying optimizations to merge the containers together
Pure *bool `json:"pure,omitempty"`
}

type StepSource struct {
Expand Down
19 changes: 19 additions & 0 deletions config/crd/bases/testworkflows.testkube.io_testworkflows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -6434,6 +6437,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -9356,6 +9362,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -10612,6 +10621,16 @@ spec:
type: string
type: object
type: array
system:
description: system configuration to define the orchestration behavior
properties:
isolatedContainers:
description: disable the behavior of merging multiple operations in a single container
type: boolean
pureByDefault:
description: assume all the steps are pure by default
type: boolean
type: object
use:
description: templates to include at a top-level of workflow
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -6323,6 +6326,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -9171,6 +9177,9 @@ spec:
paused:
description: pause the step initially
type: boolean
pure:
description: mark the step as pure, applying optimizations to merge the containers together
type: boolean
retry:
description: policy for retrying the step
properties:
Expand Down Expand Up @@ -10370,6 +10379,16 @@ spec:
type: string
type: object
type: array
system:
description: system configuration to define the orchestration behavior
properties:
isolatedContainers:
description: disable the behavior of merging multiple operations in a single container
type: boolean
pureByDefault:
description: assume all the steps are pure by default
type: boolean
type: object
type: object
required:
- spec
Expand Down

0 comments on commit 1bfae78

Please sign in to comment.