version: parse Void Linux version strings
We have ~2.5k nodes running Void Linux, which report a version string like `1.96.2_1 (Void Linux)`. Previously these versions would fail to parse, because we only expect a hyphen and `extraCommits` after the major/minor/patch numbers. Fix the version parsing logic to handle this case. Updates #19148 Change-Id: Ica4f172d080af266af7f0d69bb31483a095cd199 Signed-off-by: Alex Chan <alexc@tailscale.com>
This commit is contained in:
@@ -103,6 +103,11 @@ func parse(version string) (parsed, bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// Ignore trailer like '_1 (Void Linux)'.
|
||||
if rest[0] == '_' && strings.HasSuffix(rest, " (Void Linux)") {
|
||||
return ret, true
|
||||
}
|
||||
|
||||
// Optional extraCommits, if the next bit can be completely
|
||||
// consumed as an integer.
|
||||
if rest[0] != '-' {
|
||||
|
||||
Reference in New Issue
Block a user