From 2191617eb593e72a909bac0604b7aff0b07ecff0 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Tue, 9 Nov 2021 09:05:50 +0900 Subject: [PATCH] Remove unnecessary scale-target-not-found error on in_progress workflow_job event (#927) Ref https://github.com/actions-runner-controller/actions-runner-controller/issues/877#issuecomment-955614456 --- controllers/horizontal_runner_autoscaler_webhook.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/horizontal_runner_autoscaler_webhook.go b/controllers/horizontal_runner_autoscaler_webhook.go index 4c8b342f..9b97bd46 100644 --- a/controllers/horizontal_runner_autoscaler_webhook.go +++ b/controllers/horizontal_runner_autoscaler_webhook.go @@ -224,7 +224,7 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) Handle(w http.Respons labels := e.WorkflowJob.Labels - switch e.GetAction() { + switch action := e.GetAction(); action { case "queued", "completed": target, err = autoscaler.getJobScaleUpTargetForRepoOrOrg( context.TODO(), @@ -248,7 +248,13 @@ func (autoscaler *HorizontalRunnerAutoscalerGitHubWebhook) Handle(w http.Respons } } default: + ok = true + w.WriteHeader(http.StatusOK) + + log.V(2).Info("Received and ignored a workflow_job event as it triggers neither scale-up nor scale-down", "action", action) + + return } case *gogithub.PingEvent: ok = true