mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 06:49:40 +02:00
fix(ing): nodeport validate and show errors [EE-4373] (#7801)
This commit is contained in:
parent
fd91de3571
commit
7a6ff10268
13 changed files with 135 additions and 62 deletions
|
@ -13,14 +13,24 @@ class KubernetesFormValidationHelper {
|
|||
}
|
||||
|
||||
static getDuplicates(names) {
|
||||
const groupped = _.groupBy(names);
|
||||
const grouped = _.groupBy(names);
|
||||
const res = {};
|
||||
_.forEach(names, (name, index) => {
|
||||
if (name && groupped[name].length > 1) {
|
||||
if (name && grouped[name].length > 1) {
|
||||
res[index] = name;
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
static getDuplicateNodePorts(serviceNodePorts, allOtherNodePorts) {
|
||||
const res = {};
|
||||
serviceNodePorts.forEach((sNodePort, index) => {
|
||||
if (allOtherNodePorts.includes(sNodePort) || serviceNodePorts.filter((snp) => snp === sNodePort).length > 1) {
|
||||
res[index] = sNodePort;
|
||||
}
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
export default KubernetesFormValidationHelper;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue