Skip to content

Commit

Permalink
Changes to remove the new field added
Browse files Browse the repository at this point in the history
  • Loading branch information
ammont82 committed Jan 8, 2025
1 parent 815637d commit d076e74
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ const ClusterDeploymentDetailsForm: React.FC<ClusterDeploymentDetailsFormProps>
: undefined;
const isEditFlow = !!clusterDeployment;

const agentControlPlaneAgents = agentClusterInstall
? agentClusterInstall.spec?.provisionRequirements.controlPlaneAgents
: 3;

const { values } = useFormikContext<ClusterDetailsValues>();

const cpuArchitectures = React.useMemo(() => {
Expand Down Expand Up @@ -81,7 +77,6 @@ const ClusterDeploymentDetailsForm: React.FC<ClusterDeploymentDetailsFormProps>
extensionAfter={extensionAfter}
isNutanix={isNutanix}
cpuArchitectures={cpuArchitectures}
agentControlPlaneAgents={agentControlPlaneAgents}
/>
</StackItem>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export type ClusterDetailsFormFieldsProps = {
versions: OpenshiftVersionOptionType[];
isNutanix?: boolean;
cpuArchitectures?: string[];
agentControlPlaneAgents?: number;
};

export const BaseDnsHelperText: React.FC<{ name?: string; baseDnsDomain?: string }> = ({
Expand Down Expand Up @@ -51,7 +50,6 @@ export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> =
extensionAfter,
isNutanix,
cpuArchitectures,
agentControlPlaneAgents,
}) => {
const { values, setFieldValue } = useFormikContext<ClusterDetailsValues>();
const { name, baseDnsDomain } = values;
Expand Down Expand Up @@ -112,11 +110,7 @@ export const ClusterDetailsFormFields: React.FC<ClusterDetailsFormFieldsProps> =
}}
/>
)}
<ControlPlaneNodesDropdown
isNutanix={isNutanix}
isDisabled={isEditFlow}
agentControlPlaneAgents={agentControlPlaneAgents}
/>
<ControlPlaneNodesDropdown isNutanix={isNutanix} isDisabled={isEditFlow} />
{!isNutanix && (
<CpuArchitectureDropdown cpuArchitectures={cpuArchitectures} isDisabled={isEditFlow} />
)}
Expand Down
1 change: 1 addition & 0 deletions libs/ui-lib/lib/cim/components/helpers/toAssisted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<number | 3>(
Expand Down Expand Up @@ -87,7 +85,7 @@ const ControlPlaneNodesDropdown = ({
label={t('ai:Number of control plane nodes')}
isRequired
>
{agentControlPlaneAgents}
{selectedValue}
</StaticField>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
};

Expand Down
2 changes: 1 addition & 1 deletion libs/ui-lib/lib/common/components/clusterWizard/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export type ClusterDetailsValues = {
platform: PlatformType;
customOpenshiftSelect: OpenshiftVersionOptionType | null;
userManagedNetworking: boolean;
controlPlaneCount: number;
controlPlaneAgents: number;
};

export type HostsValidationsProps<S extends string, V extends string[]> = {
Expand Down

0 comments on commit d076e74

Please sign in to comment.