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:
Alex Chan
2026-03-31 10:46:00 +01:00
committed by Alex Chan
parent 211ef67222
commit 9c1d59f00e
2 changed files with 8 additions and 0 deletions
+5
View File
@@ -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] != '-' {