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