mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-08-07 02:39:54 +00:00
Backport cluster-reset fix (#3989)
Signed-off-by: dereknola <derek.nola@suse.com>
This commit is contained in:
@@ -62,17 +62,18 @@ func (c *Cluster) start(ctx context.Context) error {
|
||||
rebootstrap := func() error {
|
||||
return c.storageBootstrap(ctx)
|
||||
}
|
||||
if err := c.managedDB.Reset(ctx, rebootstrap); err != nil {
|
||||
return err
|
||||
}
|
||||
return c.managedDB.Reset(ctx, rebootstrap)
|
||||
case c.config.ClusterReset:
|
||||
if _, err := os.Stat(resetFile); err != nil {
|
||||
if !os.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("cluster-reset was successfully performed, please remove the cluster-reset flag and start %s normally, if you need to perform another cluster reset, you must first manually delete the %s file", version.Program, resetFile)
|
||||
rebootstrap := func() error {
|
||||
return c.storageBootstrap(ctx)
|
||||
}
|
||||
return c.managedDB.Reset(ctx, rebootstrap)
|
||||
}
|
||||
return fmt.Errorf("cluster-reset was successfully performed, please remove the cluster-reset flag and start %s normally, if you need to perform another cluster reset, you must first manually delete the %s file", version.Program, resetFile)
|
||||
}
|
||||
|
||||
// removing the reset file and ignore error if the file doesn't exist
|
||||
|
||||
Reference in New Issue
Block a user