From 8405da92a68ffc8267fed02a4689e55387299248 Mon Sep 17 00:00:00 2001 From: christian-calabrese Date: Mon, 28 Oct 2024 13:46:12 +0100 Subject: [PATCH] feat: Keda self-hosted runner scaler considers runner's labels (#368) feat: add labels to autoscaler keda --- container_app_job_gh_runner/locals.tf | 4 ++-- container_app_job_gh_runner_v2/locals.tf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/container_app_job_gh_runner/locals.tf b/container_app_job_gh_runner/locals.tf index eb064989..8df639ed 100644 --- a/container_app_job_gh_runner/locals.tf +++ b/container_app_job_gh_runner/locals.tf @@ -4,13 +4,13 @@ locals { rule = { name = "${local.project}-${var.job.name}-github-runner-rule" type = "github-runner" - metadata = { + metadata = merge({ owner = var.job.repo_owner runnerScope = "repo" repos = "${var.job.repo}" targetWorkflowQueueLength = "1" github-runner = "https://api.github.com" - } + }, length(var.runner_labels) > 0 ? { labels = join(",", var.runner_labels) } : {}) auth = [ { secretRef = "personal-access-token" diff --git a/container_app_job_gh_runner_v2/locals.tf b/container_app_job_gh_runner_v2/locals.tf index 99a0f09d..c00fd12d 100644 --- a/container_app_job_gh_runner_v2/locals.tf +++ b/container_app_job_gh_runner_v2/locals.tf @@ -4,13 +4,13 @@ locals { rule = { name = "${local.project}-${var.job.name}-github-runner-rule" type = "github-runner" - metadata = { + metadata = merge({ owner = var.job_meta.repo_owner runnerScope = var.job_meta.runner_scope repos = "${var.job_meta.repo}" targetWorkflowQueueLength = var.job_meta.target_workflow_queue_length github-runner = var.job_meta.github_runner - } + }, length(var.runner_labels) > 0 ? { labels = join(",", var.runner_labels) } : {}) auth = [ { secretRef = "personal-access-token"