Skip to content

Commit

Permalink
feat: trigger namespace reg and action parameters
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin committed Jan 23, 2025
1 parent e35b203 commit c71bd24
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 1 deletion.
11 changes: 10 additions & 1 deletion api/testtriggers/v1/testtrigger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ type TestTriggerSpec struct {
// What resource probes should be matched
ProbeSpec *TestTriggerProbeSpec `json:"probeSpec,omitempty"`
// Action represents what needs to be executed for selected Execution
Action TestTriggerAction `json:"action"`
Action TestTriggerAction `json:"action"`
ActionParameters *TestTriggerActionParameters `json:"actionParameters,omitempty"`
// Execution identifies for which test execution should an Action be executed
Execution TestTriggerExecution `json:"execution"`
// TestSelector identifies on which Testkube Kubernetes Objects an Action should be taken
Expand Down Expand Up @@ -157,6 +158,8 @@ type TestTriggerSelector struct {
NameRegex string `json:"nameRegex,omitempty"`
// Namespace of the Kubernetes object
Namespace string `json:"namespace,omitempty"`
// kubernetes resource namespace regex
NamespaceRegex string `json:"namespaceRegex,omitempty"`
// LabelSelector is used to identify a group of Kubernetes Objects based on their metadata labels
LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}
Expand Down Expand Up @@ -223,6 +226,12 @@ type TestTriggerProbeSpec struct {
Delay int32 `json:"delay,omitempty"`
}

// supported action parameters for test triggers
type TestTriggerActionParameters struct {
Config map[string]string `json:"config,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
}

//+kubebuilder:object:root=true

// TestTriggerList contains a list of TestTrigger
Expand Down
34 changes: 34 additions & 0 deletions api/testtriggers/v1/zz_generated.deepcopy.go

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

18 changes: 18 additions & 0 deletions config/crd/bases/tests.testkube.io_testtriggers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,18 @@ spec:
enum:
- run
type: string
actionParameters:
description: supported action parameters for test triggers
properties:
config:
additionalProperties:
type: string
type: object
tags:
additionalProperties:
type: string
type: object
type: object
concurrencyPolicy:
description: ConcurrencyPolicy defines concurrency policy for selected
Execution
Expand Down Expand Up @@ -272,6 +284,9 @@ spec:
namespace:
description: Namespace of the Kubernetes object
type: string
namespaceRegex:
description: kubernetes resource namespace regex
type: string
type: object
testSelector:
description: TestSelector identifies on which Testkube Kubernetes
Expand Down Expand Up @@ -332,6 +347,9 @@ spec:
namespace:
description: Namespace of the Kubernetes object
type: string
namespaceRegex:
description: kubernetes resource namespace regex
type: string
type: object
required:
- action
Expand Down

0 comments on commit c71bd24

Please sign in to comment.