Skip to content

Commit

Permalink
fix: set identifier max length to match k8s service name limit
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jul 10, 2018
1 parent 4bf5d18 commit ad0a54f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module:

# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain consecutive
# dashes
# dashes or be longer than 63 characters.
#
# Optional.
name:
Expand Down Expand Up @@ -177,7 +177,7 @@ project:

# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain
# consecutive dashes
# consecutive dashes or be longer than 63 characters.
#
# Required.
name:
Expand All @@ -203,7 +203,7 @@ module:

# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain consecutive
# dashes
# dashes or be longer than 63 characters.
#
# Optional.
name:
Expand Down Expand Up @@ -328,7 +328,7 @@ module:

# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain consecutive
# dashes
# dashes or be longer than 63 characters.
#
# Optional.
name:
Expand Down Expand Up @@ -412,7 +412,7 @@ module:
# Optional.
- # Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must
# start with a letter, and cannot end with a dash) and additionally cannot contain
# consecutive dashes
# consecutive dashes or be longer than 63 characters.
#
# Required.
name:
Expand All @@ -423,7 +423,7 @@ module:
dependencies:
# Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes,
# must start with a letter, and cannot end with a dash) and additionally cannot contain
# consecutive dashes
# consecutive dashes or be longer than 63 characters.
#
# Optional.
-
Expand Down
7 changes: 4 additions & 3 deletions src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export const joiPrimitive = () => Joi.alternatives().try(Joi.number(), Joi.strin
export const identifierRegex = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/
export const envVarRegex = /^(?!GARDEN)[A-Z_][A-Z0-9_]*$/

export const joiIdentifier = () => Joi
.string().regex(identifierRegex)
export const joiIdentifier = () => Joi.string()
.regex(identifierRegex)
.max(63)
.description(
"Valid RFC1035/RFC1123 (DNS) label (may contain lowercase letters, numbers and dashes, must start with a letter, " +
"and cannot end with a dash) and additionally cannot contain consecutive dashes",
"and cannot end with a dash) and additionally cannot contain consecutive dashes or be longer than 63 characters.",
)

export const joiIdentifierMap = (valueSchema: JoiObject) => Joi
Expand Down

0 comments on commit ad0a54f

Please sign in to comment.