Skip to content

Commit af7c5e0

Browse files
authored
Allow version regex expression to support wider range of version expressions (ahmetb#47)
1 parent 394c85f commit af7c5e0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ func isOptionalMember(m types.Member) bool {
600600
func apiVersionForPackage(pkg *types.Package) (string, string, error) {
601601
group := groupName(pkg)
602602
version := pkg.Name // assumes basename (i.e. "v1" in "core/v1") is apiVersion
603-
r := `^v\d+((alpha|beta)\d+)?$`
603+
r := `^v\d+((alpha|beta)[a-z0-9]+)?$`
604604
if !regexp.MustCompile(r).MatchString(version) {
605605
return "", "", errors.Errorf("cannot infer kubernetes apiVersion of go package %s (basename %q doesn't match expected pattern %s that's used to determine apiVersion)", pkg.Path, version, r)
606606
}

0 commit comments

Comments
 (0)