@@ -20,18 +20,17 @@ import (
2020 "context"
2121 "errors"
2222 "fmt"
23+ "github.com/caitlinelfring/go-env-default"
2324 "strconv"
2425 "strings"
2526 "time"
2627
27- env "github.com/caitlinelfring/go-env-default"
28-
2928 garov1alpha1 "github.com/evryfs/github-actions-runner-operator/api/v1alpha1"
3029 "github.com/evryfs/github-actions-runner-operator/controllers/githubapi"
3130 "github.com/go-logr/logr"
3231 "github.com/google/go-github/v58/github"
3332 "github.com/redhat-cop/operator-utils/pkg/util"
34- "github.com/thoas/go-funk "
33+ "github.com/samber/lo "
3534 corev1 "k8s.io/api/core/v1"
3635 apierrors "k8s.io/apimachinery/pkg/api/errors"
3736 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -127,7 +126,8 @@ func (r *GithubActionRunnerReconciler) handleScaling(ctx context.Context, instan
127126
128127 if shouldScaleUp (podRunnerPairs , instance ) {
129128 instance .Status .CurrentSize = podRunnerPairs .numPods ()
130- scale := funk .MaxInt ([]int {instance .Spec .MinRunners - podRunnerPairs .numRunners (), 1 })
129+
130+ scale := lo .Max ([]int {instance .Spec .MinRunners - podRunnerPairs .numRunners (), 1 })
131131 logger .Info ("Scaling up" , "numInstances" , scale )
132132
133133 if err := r .scaleUp (ctx , scale , instance ); err != nil {
@@ -332,9 +332,9 @@ func (r *GithubActionRunnerReconciler) listRelatedPods(ctx context.Context, cr *
332332 }
333333
334334 // filter result by owner-ref since it cannot be done server-side
335- podList .Items = funk .Filter (podList .Items , func (pod corev1.Pod ) bool {
335+ podList .Items = lo .Filter (podList .Items , func (pod corev1.Pod , _ int ) bool {
336336 return util .IsOwner (cr , & pod )
337- }).([]corev1. Pod )
337+ })
338338
339339 return podList , nil
340340}
@@ -416,9 +416,9 @@ func (r *GithubActionRunnerReconciler) getPodRunnerPairs(ctx context.Context, cr
416416 }
417417
418418 allRunners , err := r .GithubAPI .GetRunners (ctx , cr .Spec .Organization , cr .Spec .Repository , token )
419- runners := funk .Filter (allRunners , func (r * github.Runner ) bool {
420- return strings .HasPrefix (r .GetName (), cr .Name )
421- }).([] * github. Runner )
419+ runners := lo .Filter (allRunners , func (runner * github.Runner , _ int ) bool {
420+ return strings .HasPrefix (runner .GetName (), cr .Name )
421+ })
422422
423423 if err != nil {
424424 return podRunnerPairList , err
0 commit comments