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
This commit is contained in:
Yusuke Kuoka
2021-11-09 09:05:50 +09:00
committed by GitHub
parent b305e38b17
commit 2191617eb5

View File

@@ -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