mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
put etcd bootstrap save call in goroutine and update comment
Signed-off-by: Brian Downs <brian.downs@gmail.com>
This commit is contained in:
parent
989b21a0da
commit
400a632666
@ -96,14 +96,19 @@ func (c *Cluster) Start(ctx context.Context) (<-chan struct{}, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// at this point, if etcd is in use, it's up, ready,
|
||||
// and bootstrapping is complete so save the bootstrap
|
||||
// data
|
||||
// at this point, if etcd is in use, it's bootstrapping is complete
|
||||
// so save the bootstrap data. We will need for etcd to be up. If
|
||||
// the save call returns an error, we panic since subsequent etcd
|
||||
// snapshots will be empty.
|
||||
if c.managedDB != nil {
|
||||
go func() {
|
||||
for range ready {
|
||||
if err := c.save(ctx); err != nil {
|
||||
return nil, err
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
return ready, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user