Skip to content

Commit efe8f87

Browse files
authored
Fix gofmt to validate Experiment name (#1545)
1 parent e3ccbcf commit efe8f87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/webhook/v1beta1/experiment/validator/validator.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ func (g *DefaultValidator) InjectClient(c client.Client) {
6969
func (g *DefaultValidator) ValidateExperiment(instance, oldInst *experimentsv1beta1.Experiment) error {
7070
namingConvention, _ := regexp.Compile("^[a-z]([-a-z0-9]*[a-z0-9])?")
7171
if !namingConvention.MatchString(instance.Name) {
72-
msg :="Name must consist of lower case alphanumeric characters or '-'," +
72+
msg := "name must consist of lower case alphanumeric characters or '-'," +
7373
" start with an alphabetic character, and end with an alphanumeric character" +
74-
" (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?)'"
74+
" (e.g. 'my-name', or 'abc-123', regex used for validation is '^[a-z]([-a-z0-9]*[a-z0-9])?)'"
7575

7676
return fmt.Errorf(msg)
7777
}

0 commit comments

Comments
 (0)