From 908c5bddf767672324239ff5e080ec27762f4b56 Mon Sep 17 00:00:00 2001 From: Dmitri Fedotov Date: Wed, 19 Feb 2025 12:42:13 +0200 Subject: [PATCH] Add support for kvm compute clusters --- internal/handlers/utils.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/handlers/utils.go b/internal/handlers/utils.go index 55180dd..daebce9 100644 --- a/internal/handlers/utils.go +++ b/internal/handlers/utils.go @@ -46,11 +46,11 @@ func jsonUnmarshalStrict[T any](payload []byte) (T, error) { // terraform-deployment) var ( - regionRx = regexp.MustCompile(`^[a-z]{2}-[a-z]{2}-[0-9]$`) // e.g. "qa-de-1" - clusterRx = regexp.MustCompile(`^(?:(?:|[a-z]-|ci[0-9]?-|st[0-9]?-|gh-actions-|cc[0-9]{3}-)?[a-z]{2}-[a-z]{2}-[0-9]{1,3}|k-master)$`) // e.g. "qa-de-1" or "s-qa-de-1" or "ci-eu-de-2" or "st3-qa-de-1" or "a-qa-de-100" or "gh-actions-eu-de-2" or "cc274-qa-de-1" or "k-master" - gitCommitRx = regexp.MustCompile(`^[0-9a-f]{40}$`) // SHA-1 digest with lower-case digits - buildNumberRx = regexp.MustCompile(`^[1-9][0-9]*(?:\.[1-9][0-9]*)?$`) // e.g. "23" or "42.1" - sapUserIDRx = regexp.MustCompile(`^(?:C[0-9]{7}|[DI][0-9]{6})$`) // e.g. "D123456" or "C1234567" + regionRx = regexp.MustCompile(`^[a-z]{2}-[a-z]{2}-[0-9]$`) // e.g. "qa-de-1" + clusterRx = regexp.MustCompile(`^(?:(?:|[a-z]-|ci[0-9]?-|st[0-9]?-|gh-actions-|cc[0-9]{3}-|cc-[a-z][0-9]-)?[a-z]{2}-[a-z]{2}-[0-9]{1,3}|k-master)$`) // e.g. "qa-de-1" or "s-qa-de-1" or "ci-eu-de-2" or "st3-qa-de-1" or "a-qa-de-100" or "gh-actions-eu-de-2" or "cc274-qa-de-1" or "cc-b0-qa-de-1" or "k-master" + gitCommitRx = regexp.MustCompile(`^[0-9a-f]{40}$`) // SHA-1 digest with lower-case digits + buildNumberRx = regexp.MustCompile(`^[1-9][0-9]*(?:\.[1-9][0-9]*)?$`) // e.g. "23" or "42.1" + sapUserIDRx = regexp.MustCompile(`^(?:C[0-9]{7}|[DI][0-9]{6})$`) // e.g. "D123456" or "C1234567" ) func isClusterLocatedInRegion(cluster, region string) bool {