@@ -19,6 +19,7 @@ package apimachinery
19
19
import (
20
20
"k8s.io/apimachinery/pkg/version"
21
21
"k8s.io/kubernetes/test/e2e/framework"
22
+ "regexp"
22
23
23
24
"github.com/onsi/ginkgo"
24
25
)
@@ -34,11 +35,18 @@ var _ = SIGDescribe("get-code-version", func() {
34
35
framework .ExpectNoError (err , "Fail to access ServerVersion" )
35
36
36
37
ginkgo .By ("Confirm major version" )
37
- framework .ExpectEqual (version .Major , "1" , "unable to find major version" )
38
+ re := regexp .MustCompile ("[1-9]" )
39
+ framework .ExpectEqual (re .FindString (version .Major ), version .Major , "unable to find major version" )
38
40
framework .Logf ("Major version: %v" , version .Major )
39
41
40
42
ginkgo .By ("Confirm minor version" )
41
- framework .ExpectEqual (version .Minor , "19+" , "unable to find minor version" )
43
+
44
+ re = regexp .MustCompile ("[^0-9]+" )
45
+ cleanMinorVersion := re .ReplaceAllString (version .Minor , "" )
46
+ framework .Logf ("cleanMinorVersion: %v" , cleanMinorVersion )
47
+
48
+ re = regexp .MustCompile ("[0-9]+" )
49
+ framework .ExpectEqual (re .FindString (version .Minor ), cleanMinorVersion , "unable to find minor version" )
42
50
framework .Logf ("Minor version: %v" , version .Minor )
43
51
})
44
52
})
0 commit comments