Skip to content

Commit

Permalink
Fix bootstrap save
Browse files Browse the repository at this point in the history
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
  • Loading branch information
galal-hussein committed Mar 30, 2021
1 parent a129763 commit 31a5251
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions pkg/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,25 @@ func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error) {
return nil, errors.Wrap(err, "start managed database")
}

// get the wait channel for testing managed database readiness
ready, err := c.testClusterDB(ctx)
if err != nil {
if c.shouldBootstrap {
if err := c.bootstrapped(); err != nil {
return nil, err
}
return nil, err
}

// if necessary, store bootstrap data to datastore
if c.saveBootstrap {
if err := c.save(ctx); err != nil {
return nil, err
}
}

// if necessary, record successful bootstrap
if c.shouldBootstrap {
if err := c.bootstrapped(); err != nil {
return nil, err
}
}

return ready, c.startStorage(ctx)

}
Expand Down

0 comments on commit 31a5251

Please sign in to comment.