From 44c06c21ce89a011a56f56e4167ba8d962f53eb6 Mon Sep 17 00:00:00 2001 From: Andrei Vydrin Date: Tue, 21 Feb 2023 07:37:42 +0700 Subject: [PATCH] fix: case-insensitive webhook label matching (#2302) Co-authored-by: Yusuke Kuoka --- .../horizontal_runner_autoscaler_webhook.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/actions.summerwind.net/horizontal_runner_autoscaler_webhook.go b/controllers/actions.summerwind.net/horizontal_runner_autoscaler_webhook.go index 5f1f1500..96be3987 100644 --- a/controllers/actions.summerwind.net/horizontal_runner_autoscaler_webhook.go +++ b/controllers/actions.summerwind.net/horizontal_runner_autoscaler_webhook.go @@ -22,6 +22,7 @@ import ( "fmt" "io" "net/http" + "strings" "sync" "time" @@ -608,7 +609,7 @@ HRA: // TODO labels related to OS and architecture needs to be explicitly declared or the current implementation will not be able to find them. for _, l2 := range rs.Spec.Labels { - if l == l2 { + if strings.EqualFold(l, l2) { matched = true break } @@ -639,7 +640,7 @@ HRA: // TODO labels related to OS and architecture needs to be explicitly declared or the current implementation will not be able to find them. for _, l2 := range rd.Spec.Template.Spec.Labels { - if l == l2 { + if strings.EqualFold(l, l2) { matched = true break }