Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/afraid-geese-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mia-platform/console-types": patch
---

fix: max length to k8s resource names
2 changes: 1 addition & 1 deletion packages/console-types/src/strings/en.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"endpoint.basePath.patternError": "Must start with \"/\" and can contain alphanumeric characters and the symbols \"_\", \"-\", and \".\", optionally preceded by \":\"",
"configMountPath.patternError": "Can contain alphanumeric characters, parentheses, spaces and the symbols - , _ , . , | , \\ , / , ! , \" , £, $ , % , & , = , ? , ^ ,* , +, @",
"resourceName.patternError": "Must start with a lowercase character and can contain lowercase letters, numbers and the symbol \"-\". Cannot end with \"-\"",
"resourceName.patternError": "Must start with a lowercase character and can contain lowercase letters, numbers and the symbol \"-\". Cannot end with \"-\". Cannot exceed 253 characters in length",
"dockerImage.patternError": "Must respect the format host/imagename:tag, where host and tag are optional. Image name and tag can be interpolated",
"configMapFileName.patternError": "Can contain alphanumeric characters and the symbols \"_\", \"-\" and \".\"",
"swaggerPath.patternError": "Must start with \"/\". Can contain alphanumeric characters and the symbols \"_\", \"-\" and \".\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/console-types/src/strings/it.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"endpoint.basePath.patternError": "Deve iniziare con \"/\" e può contenere caratteri alfanumerici e i simboli \"_\", \"-\" e \".\", eventualmente preceduti da \":\"",
"configMountPath.patternError": "Può contenere caratteri alfanumerici, parentesi, spazi e i simboli - , _ , . , | , \\ , / , ! , \" , £, $ , % , & , = , ? , ^ ,* , +, @",
"resourceName.patternError": "Deve iniziare con una lettera minuscola e può contenere lettere minuscole, numeri e il simbolo \"-\". Non può terminare con \"-\"",
"resourceName.patternError": "Deve iniziare con una lettera minuscola e può contenere lettere minuscole, numeri e il simbolo \"-\". Non può terminare con \"-\". Non può superare i 253 caratteri di lunghezza",
"dockerImage.patternError": "Deve rispettare il formato host/imagename:tag, con host e tag opzionali. I valori di imagename e tag possono essere interpolati",
"configMapFileName.patternError": "Può contenere caratteri alfanumerici e i simboli \"_\", \"-\" e \".\"",
"swaggerPath.patternError": "Deve iniziare con \"/\". Può contenere caratteri alfanumerici e i simboli \"_\", \"-\" e \".\"",
Expand Down
5 changes: 5 additions & 0 deletions packages/console-types/src/types/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { ownersSchema } from './collections'
export const serviceName = {
type: 'string',
minLength: 1,
maxLength: 253,
pattern: '^[a-z]([-a-z0-9]*[a-z0-9])?$',
[VALIDATION_ERROR_ID]: 'resourceName.patternError',
} as const
Expand Down Expand Up @@ -63,6 +64,8 @@ export const swaggerPath = {

export const serviceSecretName = {
type: 'string',
minLength: 1,
maxLength: 253,
pattern: '^[a-z][a-z0-9]*(-[a-z0-9]+)*$',
[VALIDATION_ERROR_ID]: 'resourceName.patternError',
} as const
Expand All @@ -75,6 +78,8 @@ export const serviceSecretKey = {

export const configMapName = {
type: 'string',
minLength: 1,
maxLength: 253,
pattern: '^[a-z][a-z0-9]*(-[a-z0-9]+)*$',
[VALIDATION_ERROR_ID]: 'resourceName.patternError',
} as const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,8 @@ Object {
"type": "string",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -3304,6 +3306,7 @@ Object {
"type": "boolean",
},
"service": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -4076,6 +4079,7 @@ Object {
"type": "object",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -4156,6 +4160,8 @@ Object {
"x-validation-error-id": "configMountPath.patternError",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -4216,6 +4222,7 @@ Object {
"type": "array",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand All @@ -4231,6 +4238,8 @@ Object {
"x-validation-error-id": "configMountPath.patternError",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -4269,6 +4278,7 @@ Object {
"type": "string",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -4360,6 +4370,7 @@ Object {
"type": "string",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -4416,6 +4427,7 @@ Object {
"type": "array",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -4510,6 +4522,7 @@ Object {
"type": "array",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -4640,6 +4653,8 @@ Object {
"x-validation-error-id": "configMountPath.patternError",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -4777,6 +4792,8 @@ Object {
"x-validation-error-id": "serviceSecretKey.patternError",
},
"secretName": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand All @@ -4803,6 +4820,8 @@ Object {
"x-validation-error-id": "configMapFileName.patternError",
},
"configMapName": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -5070,6 +5089,7 @@ Object {
"type": "object",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -5243,6 +5263,8 @@ Object {
"x-validation-error-id": "configMountPath.patternError",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -5355,6 +5377,8 @@ Object {
"x-validation-error-id": "configMountPath.patternError",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -5507,6 +5531,8 @@ Object {
"x-validation-error-id": "serviceSecretKey.patternError",
},
"secretName": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand All @@ -5533,6 +5559,8 @@ Object {
"x-validation-error-id": "configMapFileName.patternError",
},
"configMapName": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -5803,6 +5831,7 @@ Object {
"type": "object",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"type": "string",
Expand Down Expand Up @@ -6010,6 +6039,8 @@ Object {
"x-validation-error-id": "configMountPath.patternError",
},
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down Expand Up @@ -6082,6 +6113,8 @@ Object {
"additionalProperties": false,
"properties": Object {
"name": Object {
"maxLength": 253,
"minLength": 1,
"pattern": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
"type": "string",
"x-validation-error-id": "resourceName.patternError",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ exports[`src/types/endpoints.test.ts TAP endpoints schema > must match snapshot
"service": {
"type": "string",
"minLength": 1,
"maxLength": 253,
"pattern": "^[a-z]([-a-z0-9]*[a-z0-9])?$",
"x-validation-error-id": "resourceName.patternError"
}
Expand Down