Skip to content

Commit

Permalink
[Automated] Merged refs/heads/k8s-sync-2024-11-08-1122-bcd4b74e5d97f8…
Browse files Browse the repository at this point in the history
…170fc6874b366dcf1f7a7787d3 into target main
  • Loading branch information
github-actions[bot] authored Nov 8, 2024
2 parents 9c10874 + 5a59985 commit 24b1217
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions vclusterops/start_subcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ func (vcc VClusterCommands) VStartSubcluster(options *VStartScOptions) (VCoordin
if err != nil {
return vdb, err
}
err = options.validateNewHosts(&vdb, options.NewHostList)
if err != nil {
return vdb, err
}

nodesToStart := options.collectDownHosts(&vdb)
if len(nodesToStart) == 0 {
Expand Down Expand Up @@ -203,6 +207,15 @@ func (options *VStartScOptions) collectDownHosts(vdb *VCoordinationDatabase) (no
return nodesToStart
}

func (options *VStartScOptions) validateNewHosts(vdb *VCoordinationDatabase, newHosts []string) error {
for _, h := range newHosts {
if _, exists := vdb.HostNodeMap[h]; exists {
return fmt.Errorf("host %s is already a part of the database, please provide a new host ip to start the subcluster", h)
}
}
return nil
}

// Unbound nodes that need to be started need to be re-ip'd and require node directories to be set up
func (options *VStartScOptions) checkPrepDirs(vdb *VCoordinationDatabase,
nodesToStart map[string]string, logger vlog.Printer) error {
Expand Down

0 comments on commit 24b1217

Please sign in to comment.