node pools: register a node in a node pool (#17405)

This commit is contained in:
Luiz Aoqui
2023-06-02 17:50:50 -04:00
committed by GitHub
parent c09ca1e765
commit 81f0b359dd
24 changed files with 590 additions and 51 deletions

View File

@@ -71,6 +71,10 @@ func TestCommand_Args(t *testing.T) {
[]string{"-client", "-data-dir=" + tmpDir, "-meta=invalid.=inaccessible-value"},
"Invalid Client.Meta key: invalid.",
},
{
[]string{"-client", "-node-pool=not@valid"},
"Invalid node pool",
},
}
for _, tc := range tcases {
// Make a new command. We preemptively close the shutdownCh
@@ -305,6 +309,26 @@ func TestIsValidConfig(t *testing.T) {
},
err: "must be given as an absolute",
},
{
name: "InvalidNodePoolChar",
conf: Config{
Client: &ClientConfig{
Enabled: true,
NodePool: "not@valid",
},
},
err: "Invalid node pool",
},
{
name: "InvalidNodePoolName",
conf: Config{
Client: &ClientConfig{
Enabled: true,
NodePool: structs.NodePoolAll,
},
},
err: "not allowed",
},
{
name: "NegativeMinDynamicPort",
conf: Config{