From f6216b850e7477018535f331e7f9c59df34b0c96 Mon Sep 17 00:00:00 2001 From: Jonah Back Date: Tue, 5 Jul 2022 10:19:46 -0700 Subject: [PATCH] address review comments Signed-off-by: Jonah Back --- .../src/processors/AwsEKSClusterProcessor.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/catalog-backend-module-aws/src/processors/AwsEKSClusterProcessor.ts b/plugins/catalog-backend-module-aws/src/processors/AwsEKSClusterProcessor.ts index 620f3951df..c34b247f4d 100644 --- a/plugins/catalog-backend-module-aws/src/processors/AwsEKSClusterProcessor.ts +++ b/plugins/catalog-backend-module-aws/src/processors/AwsEKSClusterProcessor.ts @@ -50,7 +50,7 @@ export class AwsEKSClusterProcessor implements CatalogProcessor { normalizeName(name: string): string { return name .trim() - .toLocaleLowerCase() + .toLocaleLowerCase('en-US') .replace(/[^a-zA-Z0-9\-]/g, '-'); } @@ -66,6 +66,12 @@ export class AwsEKSClusterProcessor implements CatalogProcessor { // location target is of format "account-id/region" const [accountId, region] = location.target.split('/'); + if (!accountId || !region) { + throw new Error( + 'AWS EKS location specified without account or region information', + ); + } + let credentials: Credentials | undefined; if (this.credentialsFactory) {