From 7dfc8d3eb26fc4fa7c1f2be6e9ced1d88c1165aa Mon Sep 17 00:00:00 2001 From: Eric Nilsson Date: Thu, 22 Oct 2020 13:38:31 +0200 Subject: [PATCH] prettified a null-check --- .../src/entity/policies/FieldFormatEntityPolicy.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts b/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts index 724de8271d..896d5b8999 100644 --- a/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts +++ b/packages/catalog-model/src/entity/policies/FieldFormatEntityPolicy.ts @@ -53,6 +53,7 @@ export class FieldFormatEntityPolicy implements EntityPolicy { let expectation; switch (validator.name) { case 'isValidLabelValue': + case 'isValidObjectName': expectation = 'a string that is sequences of [a-zA-Z0-9] separated by any of [-_.], at most 63 characters in total'; break; @@ -61,12 +62,17 @@ export class FieldFormatEntityPolicy implements EntityPolicy { case 'isValidAnnotationKey': expectation = 'a valid prefix and/or suffix'; break; + case 'isValidNamespace': + case 'isValidDnsLabel': + expectation = + 'a string that is sequences of [a-zA-Z0-9] seperated by [-], at most 63 characters in total'; + break; case 'isValidAnnotationValue': expectation = 'a string'; break; - case 'isValidNamespace': + case 'isValidKind': expectation = - 'a string that is sequences of [a-zA-Z0-9] seperated by [-], at most 63 characters in total'; + 'a string that is a sequence of [a-zA-Z][a-z0-9A-Z], at most 63 characters in total'; break; default: expectation = undefined;