From 472be6fee01bda218c7ab5c4fae0ab62d9ca5fd2 Mon Sep 17 00:00:00 2001 From: brianberzins Date: Wed, 27 Apr 2022 12:46:54 -0500 Subject: [PATCH] r - change parameter order --- reaper/reaper.go | 4 ++-- reaper/reaper_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/reaper/reaper.go b/reaper/reaper.go index 3359ce7..b9dd0ff 100644 --- a/reaper/reaper.go +++ b/reaper/reaper.go @@ -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) diff --git a/reaper/reaper_test.go b/reaper/reaper_test.go index b3342ce..4e3286c 100644 --- a/reaper/reaper_test.go +++ b/reaper/reaper_test.go @@ -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) }