From a8e2884d571541d4ef6ed5a34fb452b58ffac9a9 Mon Sep 17 00:00:00 2001 From: KubeSphere CI Bot <47586280+ks-ci-bot@users.noreply.github.com> Date: Wed, 25 Dec 2024 17:25:09 +0800 Subject: [PATCH] [master] fix: synchronize alias pattern with ksc (#4395) fix: synchronize alias pattern with ksc Signed-off-by: ROOMrepair Co-authored-by: ROOMrepair --- packages/shared/src/constants/patterns.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/shared/src/constants/patterns.ts b/packages/shared/src/constants/patterns.ts index 48129713551..237b0b5ed19 100644 --- a/packages/shared/src/constants/patterns.ts +++ b/packages/shared/src/constants/patterns.ts @@ -6,6 +6,8 @@ export const PATTERN_NAME = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?$/; export const PATTERN_USER_NAME = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/; +export const PATTERN_ALIAS_NAME = + /^[a-zA-Z0-9\u4e00-\u9fa5]([a-zA-Z0-9\u4e00-\u9fa5-]*[a-zA-Z0-9\u4e00-\u9fa5])*$/; export const PATTERN_IMAGE_NAME = /^[a-z0-9]([-a-z0-9]*[a-z0-9])?((\.|\/)[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(:([a-z0-9])*)?$/; export const PATTERN_SERVICE_NAME = /^[a-z]([-a-z0-9]*[a-z0-9])?$/; @@ -36,6 +38,3 @@ export const PATTERN_UTC_TIME = /^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[ export const PATTERN_WORD = /(?=.*?[A-Z])(?=.*?[a-z])/; export const PATTERN_NUMBER = /(?=.*?[0-9])/; export const PATTERN_INTEGER_NUMBER = /^[+]{0,1}(\d+)$/; -// export const PATTERN_ALIAS_NAME=/^[a-zA-Z0-9\u4e00-\u9fa5]([a-zA-Z0-9\u4e00-\u9fa5-]*[a-zA-Z0-9\u4e00-\u9fa5])*$/; -export const PATTERN_ALIAS_NAME = - /^[a-zA-Z0-9\u4e00-\u9fa5](?:[a-zA-Z0-9\u4e00-\u9fa5]|-(?=[a-zA-Z0-9\u4e00-\u9fa5]))*$/;