mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-12 12:28:16 +00:00
Merge pull request #1840 from balena-os/validation-message
Improve validation messages for env vars and labels
This commit is contained in:
@ -96,7 +96,11 @@ export const VariableName = new t.Type<string, string>(
|
|||||||
chain((s) =>
|
chain((s) =>
|
||||||
VAR_NAME_REGEX.test(s)
|
VAR_NAME_REGEX.test(s)
|
||||||
? t.success(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,
|
t.identity,
|
||||||
@ -121,7 +125,7 @@ export const LabelName = new t.Type<string, string>(
|
|||||||
: t.failure(
|
: t.failure(
|
||||||
s,
|
s,
|
||||||
c,
|
c,
|
||||||
"may only contain alphanumeric chars plus '-' and '.'",
|
"needs to start with a letter and may only contain alphanumeric characters plus '-' and '.'",
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user