From fcf4778baca2effb40a1f330a146d1378655da01 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sat, 19 Feb 2022 05:32:05 +0000 Subject: [PATCH] Fix regression that prevented default organizational runner group from being scale target Fixes #1131 --- .../horizontal_runner_autoscaler_webhook.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/controllers/horizontal_runner_autoscaler_webhook.go b/controllers/horizontal_runner_autoscaler_webhook.go index fc99e4f2..ea407fdb 100644 --- a/controllers/horizontal_runner_autoscaler_webhook.go +++ b/controllers/horizontal_runner_autoscaler_webhook.go @@ -614,11 +614,7 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) getManagedRunnerGroup return nil, fmt.Errorf("unsupported scale target kind: %v", kind) } - if g == "" { - continue - } - - if e == "" && o == "" { + if g != "" && e == "" && o == "" { autoscaler.Log.V(1).Info( "invalid runner group config in scale target: spec.group must be set along with either spec.enterprise or spec.organization", "scaleTargetKind", kind, @@ -631,6 +627,16 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) getManagedRunnerGroup } if e != enterprise && o != org { + autoscaler.Log.V(1).Info( + "Skipped scale target irrelevant to event", + "eventOrganization", org, + "eventEnterprise", enterprise, + "scaleTargetKind", kind, + "scaleTargetGroup", g, + "scaleTargetEnterprise", e, + "scaleTargetOrganization", o, + ) + continue }