Skip to content

Commit

Permalink
Skip initial datastore reconcile during cluster-reset
Browse files Browse the repository at this point in the history
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
  • Loading branch information
brandond committed Nov 15, 2023
1 parent 2088218 commit 7ecd587
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cluster/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
// Bootstrap attempts to load a managed database driver, if one has been initialized or should be created/joined.
// It then checks to see if the cluster needs to load bootstrap data, and if so, loads data into the
// ControlRuntimeBoostrap struct, either via HTTP or from the datastore.
func (c *Cluster) Bootstrap(ctx context.Context, snapshot bool) error {
func (c *Cluster) Bootstrap(ctx context.Context, clusterReset bool) error {
if err := c.assignManagedDriver(ctx); err != nil {
return err
}
Expand All @@ -43,7 +43,7 @@ func (c *Cluster) Bootstrap(ctx context.Context, snapshot bool) error {
c.shouldBootstrap = shouldBootstrap

if c.managedDB != nil {
if !snapshot {
if !clusterReset {
isHTTP := c.config.JoinURL != "" && c.config.Token != ""
// For secondary servers, we attempt to connect and reconcile with the datastore.
// If that fails we fallback to the local etcd cluster start
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemons/control/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ func prepare(ctx context.Context, config *config.Control) error {

cluster := cluster.New(config)

if err := cluster.Bootstrap(ctx, false); err != nil {
if err := cluster.Bootstrap(ctx, config.ClusterReset); err != nil {
return err
}

Expand Down

0 comments on commit 7ecd587

Please sign in to comment.