Merge pull request #1840 from balena-os/validation-message

Improve validation messages for env vars and labels
This commit is contained in:
bulldozer-balena[bot] 2021-12-02 20:50:54 +00:00 committed by GitHub
commit 1a5aa49044
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,7 +96,11 @@ export const VariableName = new t.Type<string, string>(
chain((s) =>
VAR_NAME_REGEX.test(s)
? t.success(s)
: t.failure(s, c, "may only contain alphanumeric chars plus '_'"),
: t.failure(
s,
c,
"needs to start with a letter and may only contain alphanumeric characters plus '_'",
),
),
),
t.identity,
@ -121,7 +125,7 @@ export const LabelName = new t.Type<string, string>(
: t.failure(
s,
c,
"may only contain alphanumeric chars plus '-' and '.'",
"needs to start with a letter and may only contain alphanumeric characters plus '-' and '.'",
),
),
),