Skip to content

Commit

Permalink
r - change parameter order
Browse files Browse the repository at this point in the history
  • Loading branch information
brianberzins committed Apr 27, 2022
1 parent 8c5e0e7 commit 472be6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions reaper/reaper.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ func (reaper reaper) getPods() *v1.PodList {
panic(err)
}
if reaper.options.annotationRequirement != nil {
podList.Items = filter(podList.Items, reaper)
podList.Items = filter(reaper, podList.Items)
}
return podList
}

func filter(pods []v1.Pod, reaper reaper) []v1.Pod {
func filter(reaper reaper, pods []v1.Pod) []v1.Pod {
var filtered []v1.Pod
for _, pod := range pods {
selector := labels.Set(pod.Annotations)
Expand Down
2 changes: 1 addition & 1 deletion reaper/reaper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestReaperFilter(t *testing.T) {
annotationRequirement: annotationRequirement,
},
}
filteredPods := filter(pods, reaper)
filteredPods := filter(reaper, pods)
assert.Equal(t, 1, len(filteredPods))
assert.Equal(t, "bearded-dragon", filteredPods[0].ObjectMeta.Name)
}

0 comments on commit 472be6f

Please sign in to comment.