Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [TKC-3146] [TKC-3147] trigger parameters and regex #313

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 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,14 @@ type TestTriggerProbeSpec struct {
Delay int32 `json:"delay,omitempty"`
}

// supported action parameters for test triggers
type TestTriggerActionParameters struct {
// configuration to pass for the workflow
Config map[string]string `json:"config,omitempty"`
// test workflow execution tags
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.

20 changes: 20 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,20 @@ spec:
enum:
- run
type: string
actionParameters:
description: supported action parameters for test triggers
properties:
config:
additionalProperties:
type: string
description: configuration to pass for the workflow
type: object
tags:
additionalProperties:
type: string
description: test workflow execution tags
type: object
type: object
concurrencyPolicy:
description: ConcurrencyPolicy defines concurrency policy for selected
Execution
Expand Down Expand Up @@ -272,6 +286,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 +349,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
Loading