server: add git revision to serf tags (#9159)
This commit is contained in:
parent
85521c49c4
commit
aac9404ee5
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:improvement
|
||||||
|
server: Add a git `revision` tag to the serf tags gossiped between servers.
|
||||||
|
```
|
|
@ -171,6 +171,7 @@ func convertServerConfig(agentConfig *Config) (*nomad.Config, error) {
|
||||||
conf.EnableDebug = agentConfig.EnableDebug
|
conf.EnableDebug = agentConfig.EnableDebug
|
||||||
|
|
||||||
conf.Build = agentConfig.Version.VersionNumber()
|
conf.Build = agentConfig.Version.VersionNumber()
|
||||||
|
conf.Revision = agentConfig.Version.Revision
|
||||||
if agentConfig.Region != "" {
|
if agentConfig.Region != "" {
|
||||||
conf.Region = agentConfig.Region
|
conf.Region = agentConfig.Region
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,6 +128,10 @@ type Config struct {
|
||||||
// operators track which versions are actively deployed
|
// operators track which versions are actively deployed
|
||||||
Build string
|
Build string
|
||||||
|
|
||||||
|
// Revision is a string that carries the version.GitCommit of Nomad that
|
||||||
|
// was compiled.
|
||||||
|
Revision string
|
||||||
|
|
||||||
// NumSchedulers is the number of scheduler thread that are run.
|
// NumSchedulers is the number of scheduler thread that are run.
|
||||||
// This can be as many as one per core, or zero to disable this server
|
// This can be as many as one per core, or zero to disable this server
|
||||||
// from doing any scheduling work.
|
// from doing any scheduling work.
|
||||||
|
|
|
@ -1517,6 +1517,7 @@ func (s *Server) setupSerf(conf *serf.Config, ch chan serf.Event, path string) (
|
||||||
conf.Tags["region"] = s.config.Region
|
conf.Tags["region"] = s.config.Region
|
||||||
conf.Tags["dc"] = s.config.Datacenter
|
conf.Tags["dc"] = s.config.Datacenter
|
||||||
conf.Tags["build"] = s.config.Build
|
conf.Tags["build"] = s.config.Build
|
||||||
|
conf.Tags["revision"] = s.config.Revision
|
||||||
conf.Tags["vsn"] = deprecatedAPIMajorVersionStr // for Nomad <= v1.2 compat
|
conf.Tags["vsn"] = deprecatedAPIMajorVersionStr // for Nomad <= v1.2 compat
|
||||||
conf.Tags["raft_vsn"] = fmt.Sprintf("%d", s.config.RaftConfig.ProtocolVersion)
|
conf.Tags["raft_vsn"] = fmt.Sprintf("%d", s.config.RaftConfig.ProtocolVersion)
|
||||||
conf.Tags["id"] = s.config.NodeID
|
conf.Tags["id"] = s.config.NodeID
|
||||||
|
|
Loading…
Reference in New Issue