mirror of https://github.com/k3s-io/k3s
Fix bootstrap save (#3129)
Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>pull/3080/head v1.19.9+k3s1
parent
a12976352c
commit
bead080d5e
|
@ -73,15 +73,25 @@ func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error) {
|
||||||
return nil, errors.Wrap(err, "start managed database")
|
return nil, errors.Wrap(err, "start managed database")
|
||||||
}
|
}
|
||||||
|
|
||||||
// get the wait channel for testing managed database readiness
|
|
||||||
ready, err := c.testClusterDB(ctx)
|
ready, err := c.testClusterDB(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
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 c.shouldBootstrap {
|
||||||
if err := c.bootstrapped(); err != nil {
|
if err := c.bootstrapped(); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ready, c.startStorage(ctx)
|
return ready, c.startStorage(ctx)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue