Skip to content

Commit

Permalink
add digit to pipeline name
Browse files Browse the repository at this point in the history
  • Loading branch information
ansakharov authored and vano144 committed Sep 7, 2022
1 parent aebae61 commit 94bac79
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ func parseConfig(json *simplejson.Json) *Config {
}

func validatePipelineName(name string) error {
matched, err := regexp.MatchString("^[a-zA-Z_]+$", name)
matched, err := regexp.MatchString("^[a-zA-Z0-9_]+$", name)
if err != nil {
return err
}
if !matched {
return fmt.Errorf(`pipeline name "%s" not satisfy regexp pattern ^[a-zA-Z_]+$`, name)
return fmt.Errorf(`pipeline name "%s" not satisfy regexp pattern ^[a-zA-Z0-9_]+$`, name)
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cfg/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ func TestParseDefaultInt(t *testing.T) {
}

func TestPipelineValidatorValid(t *testing.T) {
testName := []string{"pipeline_name", "PipeLine_NAME", "pipelinename", "PIPELINENAME"}
testName := []string{"pipeline_name", "PipeLine_NAME", "pipelinename", "PIPELINENAME", "pipeline_k8s"}
for _, tl := range testName {
assert.NoError(t, validatePipelineName(tl))
}
Expand Down

0 comments on commit 94bac79

Please sign in to comment.