mirror of
https://github.com/siderolabs/discovery-service.git
synced 2025-03-14 09:55:08 +00:00
Update removing multiple old middlewares, rework the way data is passed through the context, logging fields, etc. Fix minimum keepalive interval enforcement. Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
28 lines
456 B
Go
28 lines
456 B
Go
// Copyright (c) 2024 Sidero Labs, Inc.
|
|
//
|
|
// Use of this software is governed by the Business Source License
|
|
// included in the LICENSE file.
|
|
|
|
package server
|
|
|
|
import (
|
|
"regexp"
|
|
)
|
|
|
|
var vRE = regexp.MustCompile(`^(v\d+\.\d+\.\d+\-?[^-]*)(.*)$`)
|
|
|
|
func parseVersion(v string) string {
|
|
m := vRE.FindAllStringSubmatch(v, -1)
|
|
|
|
if len(m) == 1 && len(m[0]) == 3 {
|
|
res := m[0][1]
|
|
if m[0][2] != "" {
|
|
res += "-dev"
|
|
}
|
|
|
|
return res
|
|
}
|
|
|
|
return "unknown"
|
|
}
|