Skip to content

Commit

Permalink
fix: synchronize alias pattern with ksc (#4394)
Browse files Browse the repository at this point in the history
* fix: add name rules when create yaml app

Signed-off-by: ROOMrepair <[email protected]>

* fix: synchronize alias pattern with ksc

Signed-off-by: ROOMrepair <[email protected]>

---------

Signed-off-by: ROOMrepair <[email protected]>
  • Loading branch information
ROOMrepair authored Dec 25, 2024
1 parent ddbbaa4 commit 5b57910
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/shared/src/constants/patterns.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])?$/;
Expand Down Expand Up @@ -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]))*$/;

0 comments on commit 5b57910

Please sign in to comment.