Skip to content

Commit 6e4d6f2

Browse files
committed
Fix repository runner vm potentially not deleted
1 parent 0f5642d commit 6e4d6f2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

runner-autoscaler/pkg/srv.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,11 @@ func (s *Autoscaler) handleWebhook(ctx *gin.Context) {
609609
log.Warnf("Webhook requested to start a runner that is missing the label(s) \"%s\" - ignoring", strings.Join(missingLabels, ", "))
610610
}
611611
} else if payload.Action == COMPLETED {
612-
if payload.Job.RunnerGroupId == int64(s.conf.RunnerGroupId) {
612+
runnerGroupId := s.conf.RunnerGroupId
613+
if src.SourceType == TypeRepository {
614+
runnerGroupId = 1
615+
}
616+
if payload.Job.RunnerGroupId == runnerGroupId {
613617
if ok, missingLabels := payload.Job.hasAllLabels(s.conf.RunnerLabels); ok {
614618
deleteUrl := createCallbackUrl(ctx, s.conf.RouteDeleteVm, s.conf.SourceQueryParam, src.Name)
615619
if err := s.createCallbackTaskWithToken(ctx, deleteUrl, src.Secret, payload.Job.RunnerName); err != nil {

0 commit comments

Comments
 (0)