Skip to content

Commit

Permalink
fix: regenerate wipe id of infra machines only once per de-allocation
Browse files Browse the repository at this point in the history
We were generating a random wipe id multiple times in infra.MachineController, causing the infra provider to run many reconciles.

Fix it by doing it only once by checking the allocation information.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
  • Loading branch information
utkuozdemir committed Dec 9, 2024
1 parent ce40338 commit 6f3ce0d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ func (h *infraMachineControllerHelper) transformExtraOutput(ctx context.Context,

// the machine is deallocated, clear the cluster information and mark it for wipe by assigning it a new wipe ID

if infraMachine.TypedSpec().Value.ClusterTalosVersion != "" {
infraMachine.TypedSpec().Value.WipeId = uuid.NewString()
}

infraMachine.TypedSpec().Value.ClusterTalosVersion = ""
infraMachine.TypedSpec().Value.Extensions = nil
infraMachine.TypedSpec().Value.WipeId = uuid.NewString()

if err = r.RemoveFinalizer(ctx, clusterMachine.Metadata(), InfraMachineControllerName); err != nil {
return err
Expand Down

0 comments on commit 6f3ce0d

Please sign in to comment.