Skip to content

Commit a6c21fc

Browse files
committed
better Resource field pattern matching
1 parent 30c6d71 commit a6c21fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/scaffold/resource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ var (
3030
// See https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-versioning
3131
ResourceVersionRegexp = regexp.MustCompile("^v[1-9][0-9]*((alpha|beta)[1-9][0-9]*)?$")
3232
// ResourceKindRegexp matches Kubernetes API Kind's.
33-
ResourceKindRegexp = regexp.MustCompile("^[a-zA-Z]+$")
33+
ResourceKindRegexp = regexp.MustCompile("^[A-Z]{1}[a-zA-Z0-9]+$")
3434
// ResourceGroupRegexp matches Kubernetes API Group's.
35-
ResourceGroupRegexp = regexp.MustCompile("^[a-z]+$")
35+
ResourceGroupRegexp = regexp.MustCompile("^[a-z0-9]+$")
3636
)
3737

3838
// Resource contains the information required to scaffold files for a resource.

0 commit comments

Comments
 (0)