Skip to content

Commit

Permalink
Impl [Clusters] key/value field is missing validation (iguazio#1400)
Browse files Browse the repository at this point in the history
  • Loading branch information
illia-prokopchuk authored Jul 25, 2022
1 parent 849d1fe commit f498bd5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/i18n/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
"NO_EVENTS": "No events",
"NO_TASKS": "No {{- currentTab}} tasks",
"NOT_READY": "Not ready",
"NOT_START_WITH_FORBIDDEN_WORDS_K8S": "Must not start with 'kubernetes.io', 'k8s.io'",
"NODE": "Node",
"NODES": "Nodes",
"NONE": "None",
Expand Down
1 change: 0 additions & 1 deletion src/i18n/en/functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@
"NO_LOGS_HAVE_BEEN_FOUND": "No logs have been found...",
"NODE_SELECTORS": "Node selector",
"NORMAL": "Normal",
"NOT_START_WITH_FORBIDDEN_WORDS_ANNOTATION": "Must not start with 'kubernetes.io', 'k8s.io'",
"NOT_START_WITH_FORBIDDEN_WORDS_LABEL": "Must not start with 'kubernetes.io', 'k8s.io' or 'nuclio.io'",
"NOT_YET_DEPLOYED": "Not yet deployed",
"OAUTH2": "OAuth2",
Expand Down
11 changes: 10 additions & 1 deletion src/igz_controls/services/validation.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
{
name: 'prefixNotStart',
label: '[' + $i18next.t('functions:PREFIX', {lng: lng}) + '] ' +
$i18next.t('functions:NOT_START_WITH_FORBIDDEN_WORDS_ANNOTATION', {lng: lng}),
$i18next.t('common:NOT_START_WITH_FORBIDDEN_WORDS_K8S', {lng: lng}),
pattern: /^(?!kubernetes\.io\/)(?!k8s\.io\/)/
})
},
Expand Down Expand Up @@ -440,6 +440,15 @@
},
hiveMetastorePath: [generateRule.endNotWith('/')]
},
clusters: {
label: commonRules.prefixedQualifiedName.concat(
{
name: 'prefixNotStart',
label: '[' + $i18next.t('functions:PREFIX', {lng: lng}) + '] ' +
$i18next.t('common:NOT_START_WITH_FORBIDDEN_WORDS_K8S', {lng: lng}),
pattern: /^(?!kubernetes\.io\/)(?!k8s\.io\/)/
})
},
container: {
name: [
generateRule.validCharacters('a-z 0-9 - _'),
Expand Down

0 comments on commit f498bd5

Please sign in to comment.