Skip to content

Commit 684a41c

Browse files
committed
fix: enhance node selector validation to check for duplicate keys
1 parent e7a668f commit 684a41c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Pages/GlobalConfigurations/BuildInfra/UseBuildInfraForm.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,20 @@ const useBuildInfraForm = ({
605605
if (Object.keys(currentInputErrors[BuildInfraConfigTypes.NODE_SELECTOR] || {}).length === 0) {
606606
currentInputErrors[BuildInfraConfigTypes.NODE_SELECTOR] = null
607607
}
608+
609+
// Will validate all the keys since checking duplicates
610+
const existingKeys = currentConfiguration[BuildInfraConfigTypes.NODE_SELECTOR].value.map(
611+
(selector) => selector.key,
612+
)
613+
614+
currentConfiguration[BuildInfraConfigTypes.NODE_SELECTOR].value.forEach((selector) => {
615+
validateNodeSelector({
616+
selector,
617+
existingKeys,
618+
profileInputErrors: currentInputErrors,
619+
})
620+
})
621+
608622
break
609623
}
610624

0 commit comments

Comments
 (0)