Skip to content

Commit

Permalink
feature(controller): allow autoscaler to scale down to 0 (actions#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrand authored May 2, 2021
1 parent 0901456 commit a18ac33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/horizontalrunnerautoscaler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package controllers
import (
"context"
"fmt"
corev1 "k8s.io/api/core/v1"
"time"

corev1 "k8s.io/api/core/v1"

"github.com/summerwind/actions-runner-controller/github"
"k8s.io/apimachinery/pkg/types"

Expand Down Expand Up @@ -186,7 +187,7 @@ func (r *HorizontalRunnerAutoscalerReconciler) SetupWithManager(mgr ctrl.Manager

func (r *HorizontalRunnerAutoscalerReconciler) computeReplicasWithCache(log logr.Logger, now time.Time, rd v1alpha1.RunnerDeployment, hra v1alpha1.HorizontalRunnerAutoscaler) (int, int, *int, error) {
minReplicas := defaultReplicas
if hra.Spec.MinReplicas != nil && *hra.Spec.MinReplicas > 0 {
if hra.Spec.MinReplicas != nil && *hra.Spec.MinReplicas >= 0 {
minReplicas = *hra.Spec.MinReplicas
}

Expand Down

0 comments on commit a18ac33

Please sign in to comment.