2023-03-28 18:39:22 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-03-28 18:39:22 +00:00
|
|
|
|
2017-09-06 05:57:29 +00:00
|
|
|
package metadata
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/hashicorp/go-version"
|
|
|
|
"github.com/hashicorp/serf/serf"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Build extracts the Consul version info for a member.
|
|
|
|
func Build(m *serf.Member) (*version.Version, error) {
|
|
|
|
str := versionFormat.FindString(m.Tags["build"])
|
|
|
|
return version.NewVersion(str)
|
|
|
|
}
|