mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
fix(app): fix env var state and validation [EE-6232] (#10941)
Co-authored-by: testa113 <testa113>
This commit is contained in:
parent
067a7d148f
commit
55f66f161e
3 changed files with 8 additions and 7 deletions
|
@ -7,19 +7,19 @@ export function kubeEnvVarValidationSchema(): SchemaOf<EnvVar[]> {
|
|||
return array(
|
||||
object({
|
||||
name: string()
|
||||
.required('Name is required')
|
||||
.required('Environment variable name is required')
|
||||
.matches(
|
||||
/^[a-zA-Z][a-zA-Z0-9_.-]*$/,
|
||||
`This field must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1'.`
|
||||
`This field must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit (e.g. 'my.env-name', or 'MY_ENV.NAME', or 'MyEnvName1'`
|
||||
),
|
||||
value: string().default(''),
|
||||
needsDeletion: bool().default(false),
|
||||
})
|
||||
).test(
|
||||
'unique',
|
||||
'This environment variable is already defined.',
|
||||
'This environment variable is already defined',
|
||||
buildUniquenessTest(
|
||||
() => 'This environment variable is already defined.',
|
||||
() => 'This environment variable is already defined',
|
||||
'name'
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue