Fix bootstrap save (#3129)

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
pull/3080/head v1.19.9+k3s1
Hussein Galal 2021-03-30 22:02:15 +02:00 committed by GitHub
parent a12976352c
commit bead080d5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 5 deletions

View File

@ -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)
}