Skip to content

Commit

Permalink
renameVar
Browse files Browse the repository at this point in the history
  • Loading branch information
njtran committed May 4, 2023
1 parent ed56e4b commit 9255b6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/controllers/deprovisioning/multimachineconsolidation.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ func (m *MultiMachineConsolidation) firstNMachineConsolidationOption(ctx context

// ensure that the action is sensical for replacements, see explanation on filterOutSameType for why this is
// required
instanceTypeFiltered := false
replacementHasValidInstanceTypes := false
if cmd.Action() == ReplaceAction {
cmd.replacements[0].InstanceTypeOptions = filterOutSameType(cmd.replacements[0], candidatesToConsolidate)
instanceTypeFiltered = len(cmd.replacements[0].InstanceTypeOptions) == 0
replacementHasValidInstanceTypes = len(cmd.replacements[0].InstanceTypeOptions) > 0
}

// instanceTypeFiltered will be false if the replacement action has valid instance types remaining after filtering.
if !instanceTypeFiltered || cmd.Action() == DeleteAction {
// replacementHasValidInstanceTypes will be false if the replacement action has valid instance types remaining after filtering.
if replacementHasValidInstanceTypes || cmd.Action() == DeleteAction {
// we can consolidate machines [0,mid]
lastSavedCommand = cmd
min = mid + 1
Expand Down

0 comments on commit 9255b6a

Please sign in to comment.