Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: report server version #9159

Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5c9f2ea
added setVersion
drewgonzales360 Oct 22, 2020
2e41963
Merge branch 'master' into issue-1040/warn-on-mismatched-nomad-versions
drewgonzales360 Oct 22, 2020
d81b183
small change to get feedback on implementation
drewgonzales360 Oct 22, 2020
1f4c046
self review, remove test for version in testWrapNonJson
drewgonzales360 Oct 22, 2020
8cce0dc
Merge branch 'nomad-upstream' into issue-1040/warn-on-mismatched-noma…
drewgonzales360 Oct 22, 2020
53986dd
check for null WriteMeta
drewgonzales360 Oct 22, 2020
920351f
Merge branch 'master' into issue-1040/warn-on-mismatched-nomad-versions
drewgonzales360 Nov 2, 2020
b05e645
Merge branch 'main' of github.com:hashicorp/nomad into issue-1040/war…
drewgonzales360 Oct 17, 2021
4fa24c3
add version api change
drewgonzales360 Oct 17, 2021
28f724d
remove the X-Nomad-Version header
drewgonzales360 Oct 17, 2021
e61c8c2
add test for version endpoint
drewgonzales360 Oct 17, 2021
aa5015c
run test in ci
drewgonzales360 Oct 17, 2021
a6235c7
don't throw error if there isn't a server
drewgonzales360 Dec 20, 2021
8d56d17
Merge branch 'main' into issue-1040/warn-on-mismatched-nomad-versions
drewgonzales360 Dec 20, 2021
c7ee53a
add changelog
drewgonzales360 Dec 20, 2021
a154f98
add revision to serf config and use agent/members
drewgonzales360 Mar 4, 2022
3bf31ce
Merge remote-tracking branch 'upstream/main' into issue-1040/warn-on-…
drewgonzales360 Mar 4, 2022
0a3717f
don't need to include revision here
drewgonzales360 Mar 4, 2022
d7bd3e8
go mod tidy
drewgonzales360 Mar 4, 2022
42033ad
remove output when calling nomad version
drewgonzales360 Apr 23, 2022
cde6108
Merge branch 'main' into issue-1040/warn-on-mismatched-nomad-versions
drewgonzales360 May 7, 2022
44f06a7
Merge branch 'main' into issue-1040/warn-on-mismatched-nomad-versions
drewgonzales360 May 14, 2022
2f7ef2d
Merge branch 'main' into issue-1040/warn-on-mismatched-nomad-versions
drewgonzales360 Oct 18, 2022
e1f01c3
fixup changelog entry
tgross Nov 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9159.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
server: Gossip the git revision
```
1 change: 1 addition & 0 deletions command/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ func convertServerConfig(agentConfig *Config) (*nomad.Config, error) {
conf.EnableDebug = agentConfig.EnableDebug

conf.Build = agentConfig.Version.VersionNumber()
conf.Revision = agentConfig.Version.Revision
tgross marked this conversation as resolved.
Show resolved Hide resolved
if agentConfig.Region != "" {
conf.Region = agentConfig.Region
}
Expand Down
4 changes: 4 additions & 0 deletions nomad/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ type Config struct {
// operators track which versions are actively deployed
Build string

// Revision is a string that carries the version.GitCommit of Nomad that
// was compiled.
Revision string
tgross marked this conversation as resolved.
Show resolved Hide resolved

// 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
// from doing any scheduling work.
Expand Down
1 change: 1 addition & 0 deletions nomad/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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["dc"] = s.config.Datacenter
conf.Tags["build"] = s.config.Build
conf.Tags["revision"] = s.config.Revision
tgross marked this conversation as resolved.
Show resolved Hide resolved
conf.Tags["vsn"] = deprecatedAPIMajorVersionStr // for Nomad <= v1.2 compat
conf.Tags["raft_vsn"] = fmt.Sprintf("%d", s.config.RaftConfig.ProtocolVersion)
conf.Tags["id"] = s.config.NodeID
Expand Down