diff --git a/pkg/cluster/managed.go b/pkg/cluster/managed.go index a7cb78ffb0..cead4d51b6 100644 --- a/pkg/cluster/managed.go +++ b/pkg/cluster/managed.go @@ -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