File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ const (
54
54
var (
55
55
ossre = regexp .MustCompile (`(?P<name>\S+)/(?P<version>\S+)` )
56
56
plusre = regexp .MustCompile (`(?P<name>\S+)/(?P<version>\S+).\((?P<plus>\S+plus\S+)\)` )
57
- agentre = regexp .MustCompile (`v(?P<major>\d).?(?P<minor>\d)?.?(?P<patch>\d)?` )
57
+ agentre = regexp .MustCompile (`v(?P<major>\d+ ).?(?P<minor>\d+ )?.?(?P<patch>\d+ )?` )
58
58
)
59
59
60
60
// ServerConfig holds the config data for an upstream server in NGINX Plus.
Original file line number Diff line number Diff line change @@ -223,6 +223,14 @@ func TestExtractAgentVersionValues(t *testing.T) {
223
223
patch : 0 ,
224
224
err : false ,
225
225
},
226
+ {
227
+ name : "v2 semver" ,
228
+ input : "v2.40.15" ,
229
+ major : 2 ,
230
+ minor : 40 ,
231
+ patch : 15 ,
232
+ err : false ,
233
+ },
226
234
{
227
235
name : "v3 semver" ,
228
236
input : "v3.0.0-hash" ,
You can’t perform that action at this time.
0 commit comments