From 62bb3b75d076389678c1538b5bf2a55fbbd7ccf2 Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Mon, 15 Sep 2025 11:50:34 +0200 Subject: [PATCH] catalog-backend: make type comparison lowercase Signed-off-by: Vincenzo Scamporlino --- .../src/ingestion/CatalogRules.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/catalog-backend/src/ingestion/CatalogRules.ts b/plugins/catalog-backend/src/ingestion/CatalogRules.ts index f6026a84cd..15e620a443 100644 --- a/plugins/catalog-backend/src/ingestion/CatalogRules.ts +++ b/plugins/catalog-backend/src/ingestion/CatalogRules.ts @@ -222,12 +222,23 @@ export class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer { } for (const matcher of matchers) { - if (entity.kind?.toLowerCase() !== matcher.kind.toLowerCase()) { + if ( + entity.kind?.toLocaleLowerCase('en-US') !== + matcher.kind.toLocaleLowerCase('en-US') + ) { continue; } - if (matcher['spec.type'] && matcher['spec.type'] !== entity.spec?.type) { - continue; + if (matcher['spec.type']) { + if (typeof entity.spec?.type !== 'string') { + continue; + } + if ( + matcher['spec.type'].toLocaleLowerCase('en-US') !== + entity.spec.type.toLocaleLowerCase('en-US') + ) { + continue; + } } return true;