diff --git a/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx b/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx index b2036a6ddc..7c0c23a9ab 100644 --- a/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +++ b/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx @@ -39,10 +39,6 @@ const ClusterDeploymentDetailsForm: React.FC : undefined; const isEditFlow = !!clusterDeployment; - const agentControlPlaneAgents = agentClusterInstall - ? agentClusterInstall.spec?.provisionRequirements.controlPlaneAgents - : 3; - const { values } = useFormikContext(); const cpuArchitectures = React.useMemo(() => { @@ -81,7 +77,6 @@ const ClusterDeploymentDetailsForm: React.FC extensionAfter={extensionAfter} isNutanix={isNutanix} cpuArchitectures={cpuArchitectures} - agentControlPlaneAgents={agentControlPlaneAgents} /> diff --git a/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx b/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx index c2dad7867f..2190098557 100644 --- a/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +++ b/libs/ui-lib/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx @@ -23,7 +23,6 @@ export type ClusterDetailsFormFieldsProps = { versions: OpenshiftVersionOptionType[]; isNutanix?: boolean; cpuArchitectures?: string[]; - agentControlPlaneAgents?: number; }; export const BaseDnsHelperText: React.FC<{ name?: string; baseDnsDomain?: string }> = ({ @@ -51,7 +50,6 @@ export const ClusterDetailsFormFields: React.FC = extensionAfter, isNutanix, cpuArchitectures, - agentControlPlaneAgents, }) => { const { values, setFieldValue } = useFormikContext(); const { name, baseDnsDomain } = values; @@ -112,11 +110,7 @@ export const ClusterDetailsFormFields: React.FC = }} /> )} - + {!isNutanix && ( )} diff --git a/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts b/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts index 2c6730bd81..bdf179cde8 100644 --- a/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts +++ b/libs/ui-lib/lib/cim/components/helpers/toAssisted.ts @@ -170,6 +170,7 @@ export const getAICluster = ({ validationsInfo: JSON.stringify(agentClusterInstall?.status?.validationsInfo || {}), cpuArchitecture: getClusterDeploymentCpuArchitecture(clusterDeployment, infraEnv), networkType: agentClusterInstall?.spec?.networking.networkType, + controlPlaneCount: agentClusterInstall?.spec?.provisionRequirements.controlPlaneAgents || 3, }; /* aiCluster.agentSelectorMasterLabels = diff --git a/libs/ui-lib/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx b/libs/ui-lib/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx index f32d4049e6..8184ff068c 100644 --- a/libs/ui-lib/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx +++ b/libs/ui-lib/lib/common/components/clusterConfiguration/ControlPlaneNodesDropdown.tsx @@ -18,11 +18,9 @@ const isDropdownItemEnabled = (controlPlaneNodeCount: number, isNutanix?: boolea const ControlPlaneNodesDropdown = ({ isDisabled = false, isNutanix, - agentControlPlaneAgents, }: { isDisabled?: boolean; isNutanix?: boolean; - agentControlPlaneAgents?: number; }) => { const { t } = useTranslation(); const [{ name, value: selectedValue }, , { setValue }] = useField( @@ -87,7 +85,7 @@ const ControlPlaneNodesDropdown = ({ label={t('ai:Number of control plane nodes')} isRequired > - {agentControlPlaneAgents} + {selectedValue} ); }; diff --git a/libs/ui-lib/lib/common/components/clusterWizard/clusterDetailsValidation.ts b/libs/ui-lib/lib/common/components/clusterWizard/clusterDetailsValidation.ts index f6db4a79cd..0b9cf32a33 100644 --- a/libs/ui-lib/lib/common/components/clusterWizard/clusterDetailsValidation.ts +++ b/libs/ui-lib/lib/common/components/clusterWizard/clusterDetailsValidation.ts @@ -82,7 +82,7 @@ export const getClusterDetailsInitialValues = ({ platform: cluster?.platform?.type || 'none', customOpenshiftSelect: null, userManagedNetworking: cluster?.userManagedNetworking || false, - controlPlaneCount: cluster?.controlPlaneCount || 3, + controlPlaneAgents: cluster?.controlPlaneCount || 3, }; }; diff --git a/libs/ui-lib/lib/common/components/clusterWizard/types.ts b/libs/ui-lib/lib/common/components/clusterWizard/types.ts index 56c109d19c..743af538fc 100644 --- a/libs/ui-lib/lib/common/components/clusterWizard/types.ts +++ b/libs/ui-lib/lib/common/components/clusterWizard/types.ts @@ -34,7 +34,7 @@ export type ClusterDetailsValues = { platform: PlatformType; customOpenshiftSelect: OpenshiftVersionOptionType | null; userManagedNetworking: boolean; - controlPlaneCount: number; + controlPlaneAgents: number; }; export type HostsValidationsProps = {