Skip to content

Commit

Permalink
fix: check for nil config
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Sukhin <vladislav@kubeshop.io>
  • Loading branch information
vsukhin committed Feb 11, 2025
1 parent 85df293 commit 181c9aa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions internal/app/api/v1/testworkflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,13 +471,17 @@ func (s *TestkubeAPI) ReRunTestWorkflowHandler() fiber.Handler {
}

request.Config = make(map[string]string)
if execution.ConfigParams == nil {
return s.ClientError(c, "get execution parameters", errors.New("missing parameters"))
}

for key, value := range execution.ConfigParams {
if value.Sensitive {
return s.ClientError(c, "get execution parameters", errors.New("can't rerun test workflow with sensitive data"))
return s.ClientError(c, "get execution parameters", errors.New("can't rerun test workflow with sensitive prameters"))
}

if value.Truncated {
return s.ClientError(c, "get execution parameters", errors.New("can't rerun test workflow with truncated data"))
return s.ClientError(c, "get execution parameters", errors.New("can't rerun test workflow with truncated parameters"))
}

if !value.EmptyValue {
Expand Down

0 comments on commit 181c9aa

Please sign in to comment.