Skip to content

Commit

Permalink
feat: [TKC-2995] Store default config variables (#6081)
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv authored Dec 16, 2024
1 parent f6b81fe commit 3a9814b
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions pkg/testworkflows/testworkflowexecutor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,15 +474,25 @@ func (e *executor) initialize(ctx context.Context, workflow *testworkflowsv1.Tes
if testworkflows.CountMapBytes(request.Config) < ConfigSizeLimit {
storeConfig := true
schema := workflow.Spec.Config

for k, _ := range request.Config {
if s, ok := schema[k]; ok && s.Sensitive {
config := make(map[string]string)
for k, v := range schema {
if v.Sensitive {
storeConfig = false
break
}
if v.Default != nil {
config[k] = v.Default.String()
}
}

for k, v := range request.Config {
if _, ok := schema[k]; ok {
config[k] = v
}
}

if storeConfig {
execution.Config = request.Config
execution.Config = config
}
}

Expand Down

0 comments on commit 3a9814b

Please sign in to comment.