Skip to content

Commit

Permalink
feat: [TKC-2726] cronjob config (#5973)
Browse files Browse the repository at this point in the history
* feat: add cronjob config

Signed-off-by: Vladislav Sukhin <[email protected]>

* feat: cronjob config model

Signed-off-by: Vladislav Sukhin <[email protected]>

---------

Signed-off-by: Vladislav Sukhin <[email protected]>
  • Loading branch information
vsukhin authored Oct 30, 2024
1 parent 7394af9 commit 9c6790e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions api/v1/testkube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9580,6 +9580,8 @@ components:
description: annotations to attach to the cron job
additionalProperties:
type: string
config:
$ref: "#/components/schemas/TestWorkflowConfigValue"

TestWorkflowExecutionCR:
type: object
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/kelseyhightower/envconfig v1.4.0
github.com/kubepug/kubepug v1.7.1
github.com/kubeshop/testkube-operator v1.17.55-0.20241029195548-ba9b7a63a87d
github.com/kubeshop/testkube-operator v1.17.55-0.20241030092155-2a57f6e797e9
github.com/minio/minio-go/v7 v7.0.47
github.com/montanaflynn/stats v0.6.6
github.com/moogar0880/problems v0.1.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kubepug/kubepug v1.7.1 h1:LKhfSxS8Y5mXs50v+3Lpyec+cogErDLcV7CMUuiaisw=
github.com/kubepug/kubepug v1.7.1/go.mod h1:lv+HxD0oTFL7ZWjj0u6HKhMbbTIId3eG7aWIW0gyF8g=
github.com/kubeshop/testkube-operator v1.17.55-0.20241029195548-ba9b7a63a87d h1:MuMJ26tJdEI8gYla2m9WuwDvaOh9DQbpOa8levKqy+A=
github.com/kubeshop/testkube-operator v1.17.55-0.20241029195548-ba9b7a63a87d/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk=
github.com/kubeshop/testkube-operator v1.17.55-0.20241030092155-2a57f6e797e9 h1:0v4W4kPfuDBJxvfkgKhDFA71AgmV0B5Jdb8dR7n4bV4=
github.com/kubeshop/testkube-operator v1.17.55-0.20241030092155-2a57f6e797e9/go.mod h1:P47tw1nKQFufdsZndyq2HG2MSa0zK/lU0XpRfZtEmIk=
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lithammer/fuzzysearch v1.1.8 h1:/HIuJnjHuXS8bKaiTMeeDlW2/AyIWk2brx1V8LFgLN4=
Expand Down
1 change: 1 addition & 0 deletions pkg/api/v1/testkube/model_test_workflow_cron_job_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ type TestWorkflowCronJobConfig struct {
Labels map[string]string `json:"labels,omitempty"`
// annotations to attach to the cron job
Annotations map[string]string `json:"annotations,omitempty"`
Config map[string]string `json:"config,omitempty"`
}
1 change: 1 addition & 0 deletions pkg/mapper/testworkflows/kube_openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ func MapEventKubeToAPI(v testworkflowsv1.Event) testkube.TestWorkflowEvent {
func MapCronJobConfigKubeToAPI(v testworkflowsv1.CronJobConfig) testkube.TestWorkflowCronJobConfig {
return testkube.TestWorkflowCronJobConfig{
Cron: v.Cron,
Config: MapConfigValueKubeToAPI(v.Config),
Labels: v.Labels,
Annotations: v.Annotations,
}
Expand Down
1 change: 1 addition & 0 deletions pkg/mapper/testworkflows/openapi_kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ func MapEventAPIToKube(v testkube.TestWorkflowEvent) testworkflowsv1.Event {
func MapCronJobConfigAPIToKube(v testkube.TestWorkflowCronJobConfig) testworkflowsv1.CronJobConfig {
return testworkflowsv1.CronJobConfig{
Cron: v.Cron,
Config: MapConfigValueAPIToKube(v.Config),
Labels: v.Labels,
Annotations: v.Annotations,
}
Expand Down

0 comments on commit 9c6790e

Please sign in to comment.