From 977dc9abc6d59358c5698e35400488538dbf2710 Mon Sep 17 00:00:00 2001 From: Montse Ortega Date: Mon, 24 Jul 2023 15:57:52 +0200 Subject: [PATCH] Patch correct platform type --- .../components/clusterWizard/ClusterDetailsForm.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx index eb6f26f2c1..71de520e79 100644 --- a/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx +++ b/libs/ui-lib/lib/ocm/components/clusterWizard/ClusterDetailsForm.tsx @@ -73,9 +73,15 @@ const ClusterDetailsForm = (props: ClusterDetailsFormProps) => { const handleSubmit = React.useCallback( async (values: OcmClusterDetailsValues) => { if (cluster) { - const platform = values.platform === 'none' ? 'baremetal' : values.platform; - const resetPlatform = cluster.userManagedNetworking ? 'baremetal' : platform; - + let resetPlatform = values.platform; + const clusterPlatform = cluster.platform?.type; + if ( + values.platform === 'none' && + clusterPlatform !== 'none' && + clusterPlatform !== 'baremetal' + ) { + resetPlatform = 'baremetal'; + } const params = ClusterDetailsService.getClusterUpdateParams(values, resetPlatform); await handleClusterUpdate(cluster.id, params); await handleCustomManifestsChange(cluster.id, clusterWizardContext.addCustomManifests);