From f79171f099a47d14c932a7a831bfdb140317f8fc Mon Sep 17 00:00:00 2001 From: Matt Spilchen Date: Wed, 27 Sep 2023 11:52:37 -0400 Subject: [PATCH] Sync from server repo (746fab2e98) --- .vscode/launch.json | 22 ---------------------- vclusterops/add_node.go | 13 +++++++------ 2 files changed, 7 insertions(+), 28 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index a090e4c..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "vcluster", - "type": "go", - "request": "launch", - "mode": "test", - "program": "${workspaceFolder}/vclusterops" - }, - { - "name": "commands", - "type": "go", - "request": "launch", - "mode": "test", - "program": "${workspaceFolder}/commands" - } - ] -} diff --git a/vclusterops/add_node.go b/vclusterops/add_node.go index c0e54b4..593a3a7 100644 --- a/vclusterops/add_node.go +++ b/vclusterops/add_node.go @@ -162,12 +162,6 @@ func (vcc *VClusterCommands) VAddNode(options *VAddNodeOptions) (VCoordinationDa } } - // add_node is aborted if requirements are not met - err = checkAddNodeRequirements(&vdb, options.NewHosts) - if err != nil { - return vdb, err - } - err = options.setInitiator(vdb.PrimaryUpNodes) if err != nil { return vdb, err @@ -180,6 +174,13 @@ func (vcc *VClusterCommands) VAddNode(options *VAddNodeOptions) (VCoordinationDa return vdb, err } + // add_node is aborted if requirements are not met. + // Here we check whether the nodes being added already exist + err = checkAddNodeRequirements(&vdb, options.NewHosts) + if err != nil { + return vdb, err + } + err = vdb.addHosts(options.NewHosts) if err != nil { return vdb, err