Skip to content

Commit 01327b8

Browse files
committed
fix: filter targetPlatforms from payload if useK8sDriver is false
1 parent 1290ca6 commit 01327b8

File tree

1 file changed

+10
-1
lines changed
  • src/Pages/GlobalConfigurations/BuildInfra

1 file changed

+10
-1
lines changed

src/Pages/GlobalConfigurations/BuildInfra/utils.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export const getBuildInfraProfilePayload = (
322322
return acc
323323
}, {})
324324

325-
// Deleting un-supported locators in case target platform is not default platform
325+
// Deleting un-supported locators in case locators are not supported by buildX
326326
Object.entries(configurations).forEach(([platformName, platformConfigurations]) => {
327327
if (platformName !== BUILD_INFRA_DEFAULT_PLATFORM_NAME) {
328328
configurations[platformName] = platformConfigurations.filter(
@@ -331,6 +331,15 @@ export const getBuildInfraProfilePayload = (
331331
}
332332
})
333333

334+
// Filtering out platforms if not using K8sDriver
335+
if (canConfigureUseK8sDriver && !profileInput.useK8sDriver) {
336+
Object.keys(configurations).forEach((platformName) => {
337+
if (platformName !== BUILD_INFRA_DEFAULT_PLATFORM_NAME) {
338+
delete configurations[platformName]
339+
}
340+
})
341+
}
342+
334343
const payload: BuildInfraProfileInfoDTO = {
335344
name: profileInput.name,
336345
description: profileInput.description?.trim(),

0 commit comments

Comments
 (0)