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

debug: Improve namespace and region support #11269

Merged
merged 24 commits into from
Oct 12, 2021
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6b13b90
Rename argNodes to generic utility function
davemay99 Oct 6, 2021
3c47f92
Add region and prefix matching for server members
davemay99 Oct 6, 2021
8897ed6
Include region and namespace in CLI output
davemay99 Oct 6, 2021
25ed8ff
Add region awareness to WaitForClient helper
davemay99 Oct 6, 2021
2db750d
Align variable names with underlying type
davemay99 Oct 6, 2021
4c8fa58
Add test for region
davemay99 Oct 6, 2021
33132cf
Add namespaces and regions to cluster meta info
davemay99 Oct 6, 2021
c43b697
Add changelog
davemay99 Oct 6, 2021
d45cfa0
Refactor WaitForClient helper function
davemay99 Oct 7, 2021
74867b1
Simplify test agent configuration functions
davemay99 Oct 7, 2021
8274faf
Tighten StringToSlice test coverage
davemay99 Oct 7, 2021
23bd22e
Clarify test names
davemay99 Oct 7, 2021
38bb29b
Rename server filter function for clarity
davemay99 Oct 7, 2021
a99ab0e
Move leader check outside loop to prevent duplicates
davemay99 Oct 7, 2021
1db4315
Adjust comment for clarity
davemay99 Oct 7, 2021
1ee480e
Fix region regression
davemay99 Oct 12, 2021
c9b0393
Refactor test client agent generation
davemay99 Oct 12, 2021
6d3c8ec
testServer already handles agent shutdown
davemay99 Oct 12, 2021
668e3bd
Use region var for expected outputs
davemay99 Oct 12, 2021
48ff716
Add test for SliceStringContainsPrefix
davemay99 Oct 12, 2021
4c9f655
Fix logic/tests for slice prefix helper functions
davemay99 Oct 12, 2021
037e801
revert testutil.WaitForClient addition
davemay99 Oct 12, 2021
37e5e22
eliminate import cycle caused by nomad/client
davemay99 Oct 12, 2021
4059695
Clarify slice HasPrefix tests
davemay99 Oct 12, 2021
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
Prev Previous commit
Next Next commit
Simplify test agent configuration functions
davemay99 committed Oct 7, 2021
commit 74867b17d81b06f3b58bdc781d40cb68eab45f36
17 changes: 3 additions & 14 deletions command/operator_debug_test.go
Original file line number Diff line number Diff line change
@@ -66,9 +66,7 @@ func TestDebug_NodeClass(t *testing.T) {
// Setup client 1 (nodeclass = clienta)
agentConfFunc1 := func(c *agent.Config) {
c.Region = "global"
c.Server.Enabled = false
c.Client.NodeClass = "clienta"
c.Client.Enabled = true
c.Client.Servers = []string{srvRPCAddr}
}

@@ -80,9 +78,7 @@ func TestDebug_NodeClass(t *testing.T) {
// Setup client 2 (nodeclass = clientb)
agentConfFunc2 := func(c *agent.Config) {
c.Region = "global"
c.Server.Enabled = false
c.Client.NodeClass = "clientb"
c.Client.Enabled = true
c.Client.Servers = []string{srvRPCAddr}
}

@@ -93,7 +89,6 @@ func TestDebug_NodeClass(t *testing.T) {

// Setup client 3 (nodeclass = clienta)
agentConfFunc3 := func(c *agent.Config) {
c.Server.Enabled = false
c.Client.NodeClass = "clienta"
c.Client.Servers = []string{srvRPCAddr}
}
@@ -149,10 +144,7 @@ func TestDebug_ClientToServer(t *testing.T) {

// Setup client 1 (nodeclass = clienta)
agentConfFunc1 := func(c *agent.Config) {
c.Region = "global"
c.Server.Enabled = false
c.Client.NodeClass = "clienta"
c.Client.Enabled = true
c.Client.Servers = []string{srvRPCAddr}
}

@@ -195,12 +187,11 @@ func TestDebug_ClientToServer(t *testing.T) {
}

func TestDebug_ClientToServer_Region(t *testing.T) {
agentConfFunc := func(c *agent.Config) {
// Start test server and API client
srv, _, url := testServer(t, false, func(c *agent.Config) {
c.Region = "testregion"
}
})

// Start test server and API client
srv, _, url := testServer(t, false, agentConfFunc)
defer srv.Shutdown()

// Wait for leadership to establish
@@ -213,9 +204,7 @@ func TestDebug_ClientToServer_Region(t *testing.T) {
// Setup client 1 (nodeclass = clienta)
agentConfFunc1 := func(c *agent.Config) {
c.Region = "testregion"
c.Server.Enabled = false
c.Client.NodeClass = "clienta"
c.Client.Enabled = true
c.Client.Servers = []string{srvRPCAddr}
}