mirror of
https://github.com/tailscale/tailscale.git
synced 2025-02-18 02:48:40 +00:00
version/mkversion: allow version override with $TS_VERSION_OVERRIDE (#10799)
This is useful to build local binaries with custom versions to test version-specific logic (like updates). Updates https://github.com/tailscale/corp/issues/16703 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>
This commit is contained in:
parent
4ec6a78551
commit
86e476c8d1
@ -199,6 +199,13 @@ func tailscaleModuleRef(modBs []byte) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func mkOutput(v verInfo) (VersionInfo, error) {
|
func mkOutput(v verInfo) (VersionInfo, error) {
|
||||||
|
if override := os.Getenv("TS_VERSION_OVERRIDE"); override != "" {
|
||||||
|
var err error
|
||||||
|
v.major, v.minor, v.patch, err = parseVersion(override)
|
||||||
|
if err != nil {
|
||||||
|
return VersionInfo{}, fmt.Errorf("failed to parse TS_VERSION_OVERRIDE: %w", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
var changeSuffix string
|
var changeSuffix string
|
||||||
if v.minor%2 == 1 {
|
if v.minor%2 == 1 {
|
||||||
// Odd minor numbers are unstable builds.
|
// Odd minor numbers are unstable builds.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user