From 79729d82d1c17be8c88163aab4152d695996ac95 Mon Sep 17 00:00:00 2001 From: Kent Rancourt Date: Thu, 9 Jan 2025 11:54:01 -0500 Subject: [PATCH] Update api/v1alpha1/freight_helpers_test.go Signed-off-by: Kent Rancourt Co-authored-by: Hidde Beydals --- api/v1alpha1/freight_helpers_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/api/v1alpha1/freight_helpers_test.go b/api/v1alpha1/freight_helpers_test.go index 50825fdf4..ac4e51804 100644 --- a/api/v1alpha1/freight_helpers_test.go +++ b/api/v1alpha1/freight_helpers_test.go @@ -25,11 +25,9 @@ func freightByCurrentStagesIndexer(obj client.Object) []string { if !ok { return nil } - currentStages := make([]string, len(freight.Status.CurrentlyIn)) - var i int + currentStages := make([]string, 0, len(freight.Status.CurrentlyIn)) for stage := range freight.Status.CurrentlyIn { - currentStages[i] = stage - i++ + currentStages = append(currentStages, stage) } return currentStages }