diff --git a/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.tsx b/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.tsx index 6f79c2fc68..ccba3d42cb 100644 --- a/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.tsx +++ b/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostSelectionStep.tsx @@ -313,6 +313,7 @@ const HostSelectionForm: React.FC = ({ onAutoSelectChange={onAutoSelectChange} onHostSelect={onHostSelect} isNutanix={isNutanix} + hostsBinding={nextRequested && !showClusterErrors} /> {(showClusterErrors || showFormErrors) && !!alerts.length && ( diff --git a/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostsSelection.tsx b/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostsSelection.tsx index a72bbb5d6b..8b5bb93dad 100644 --- a/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostsSelection.tsx +++ b/libs/ui-lib/lib/cim/components/ClusterDeployment/hostSelection/ClusterDeploymentHostsSelection.tsx @@ -42,6 +42,7 @@ const ClusterDeploymentHostsSelection: React.FC { const { t } = useTranslation(); const { values } = useFormikContext(); @@ -54,7 +55,7 @@ const ClusterDeploymentHostsSelection: React.FC { - const filtered = getAgentsForSelection(agents).filter( + const filtered = getAgentsForSelection(agents, hostsBinding).filter( (agent) => (agent.spec.clusterDeploymentName?.name === cdName && agent.spec.clusterDeploymentName?.namespace === cdNamespace) || @@ -66,7 +67,7 @@ const ClusterDeploymentHostsSelection: React.FC a.status?.inventory?.systemVendor?.manufacturer === 'Nutanix') : filtered; - }, [agents, cdNamespace, cdName, cpuArchitecture, isNutanix]); + }, [agents, hostsBinding, isNutanix, cdName, cdNamespace, cpuArchitecture]); const hostRequirementText = getHostRequirementText(isSNOCluster, isTNA, t); diff --git a/libs/ui-lib/lib/cim/components/ClusterDeployment/types.ts b/libs/ui-lib/lib/cim/components/ClusterDeployment/types.ts index 3a689e3137..251583f53a 100644 --- a/libs/ui-lib/lib/cim/components/ClusterDeployment/types.ts +++ b/libs/ui-lib/lib/cim/components/ClusterDeployment/types.ts @@ -178,6 +178,7 @@ export type ClusterDeploymentHostsSelectionProps = { onAutoSelectChange: VoidFunction; onHostSelect: VoidFunction; isNutanix: boolean; + hostsBinding?: boolean; }; export type InfraEnvAgentTableProps = Pick< diff --git a/libs/ui-lib/lib/cim/components/helpers/agents.ts b/libs/ui-lib/lib/cim/components/helpers/agents.ts index 41cad091a6..7b579d6426 100644 --- a/libs/ui-lib/lib/cim/components/helpers/agents.ts +++ b/libs/ui-lib/lib/cim/components/helpers/agents.ts @@ -18,9 +18,13 @@ const AGENT_FOR_SELECTION_STATUSES: AgentStatus[] = [ export const hostToAgent = (agents: AgentK8sResource[] = [], host: Host) => agents.find((a) => a.metadata?.uid === host.id) as AgentK8sResource; -export const getAgentsForSelection = (agents: AgentK8sResource[]) => +export const getAgentsForSelection = (agents: AgentK8sResource[], isSubmitting?: boolean) => agents.filter((agent) => { const key = getAgentStatusKey(agent); + if (isSubmitting) { + return [...AGENT_FOR_SELECTION_STATUSES, 'specSyncErr'].includes(key as AgentStatus); + } + return AGENT_FOR_SELECTION_STATUSES.includes(key as AgentStatus); });