Skip to content

Commit 29e6ea0

Browse files
kate-osbornpleshakov
authored and
Kate Osborn
committed
Update cmd/gateway/setup.go
Use re.MatchString instead of re.Match Co-authored-by: Michael Pleshakov <[email protected]>
1 parent 1b021cc commit 29e6ea0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/gateway/setup.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func GatewayControllerParam(domain string) ValidatorContext {
5959
func validateControllerName(name string) error {
6060
// Regex from: https://github.com/kubernetes-sigs/gateway-api/blob/547122f7f55ac0464685552898c560658fb40073/apis/v1alpha2/shared_types.go#L462
6161
re := regexp.MustCompile(controllerNameRegex)
62-
if !re.Match([]byte(name)) {
62+
if !re.MatchString(name) {
6363
return fmt.Errorf("invalid gateway controller name: %s; expected format is DOMAIN/PATH", name)
6464
}
6565
return nil

0 commit comments

Comments
 (0)