Skip to content

Commit

Permalink
refactor: revert fake management filter code
Browse files Browse the repository at this point in the history
  • Loading branch information
sethp-nr committed Mar 4, 2020
1 parent 3402b38 commit 5ac65a3
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1430,20 +1430,6 @@ func (f *fakeManagementCluster) GetWorkloadCluster(_ context.Context, _ types.Na
}

func (f *fakeManagementCluster) GetMachinesForCluster(ctx context.Context, cluster types.NamespacedName, filters ...internal.MachineFilter) (internal.FilterableMachineCollection, error) {
// TODO panic on non-empty filters instead
ret := make([]*clusterv1.Machine, 0, len(f.Machines))
for _, m := range f.Machines {
if func() bool {
for _, f := range filters {
if !f(m) {
return false
}
}
return true
}() {
ret = append(ret, m)
}
}
return f.Machines, nil
}

Expand Down

0 comments on commit 5ac65a3

Please sign in to comment.