Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions libs/ui-lib/lib/common/api/assisted-service/ClustersAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,6 @@ const ClustersAPI = {
params,
);
},

updateInstallConfig(clusterId: Cluster['id'], config: string) {
return client.patch(`${ClustersAPI.makeBaseURI(clusterId)}/install-config`, config, {
headers: { 'Content-Type': 'application/json' },
});
},
};

export default ClustersAPI;
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
SecurityFields,
useAlerts,
useFormikAutoSave,
ClustersAPI,
useTranslation,
} from '../../../../common';
import { useDefaultConfiguration } from '../ClusterDefaultConfigurationContext';
Expand Down Expand Up @@ -47,7 +46,6 @@ import {
V2ClusterUpdateParams,
} from '@openshift-assisted/types/assisted-installer-service';
import { useNewFeatureSupportLevel } from '../../../../common/components/newFeatureSupportLevels';
import { useFeature } from '../../../hooks/use-feature';

const NetworkConfigurationForm: React.FC<{
cluster: Cluster;
Expand All @@ -68,10 +66,6 @@ const NetworkConfigurationForm: React.FC<{
useFormikContext<NetworkConfigurationValues>();
const isAutoSaveRunning = useFormikAutoSave();
const errorFields = getFormikErrorFields(errors, touched);
const isSingleClusterFeatureEnabled = useFeature('ASSISTED_INSTALLER_SINGLE_CLUSTER_FEATURE');
const { addAlert } = useAlerts();
const dispatch = useDispatch();

// DHCP allocation is currently not supported for Nutanix hosts
// https://issues.redhat.com/browse/MGMT-12382
const isHostsPlatformTypeNutanix = React.useMemo(
Expand All @@ -85,34 +79,6 @@ const NetworkConfigurationForm: React.FC<{
}
}, [isHostsPlatformTypeNutanix, setFieldValue, values.vipDhcpAllocation]);

const onNext = React.useCallback(async () => {
if (isSingleClusterFeatureEnabled) {
try {
await ClustersAPI.updateInstallConfig(
cluster.id,
JSON.stringify(
JSON.stringify({
featureSet: 'CustomNoUpgrade',
featureGates: ['NoRegistryClusterInstall=true'],
}),
),
);
} catch (e) {
handleApiError(e, () =>
addAlert({
title: 'Failed to update install-config',
message: getApiErrorMessage(e),
}),
);
if (isUnknownServerError(e as Error)) {
dispatch(setServerUpdateError());
}
return;
}
}
clusterWizardContext.moveNext();
}, [addAlert, cluster.id, clusterWizardContext, dispatch, isSingleClusterFeatureEnabled]);

const isNextDisabled =
isSubmitting ||
isAutoSaveRunning ||
Expand All @@ -127,7 +93,7 @@ const NetworkConfigurationForm: React.FC<{
isSubmitting={isSubmitting}
isNextDisabled={isNextDisabled}
isWaitingForHosts={!canNextNetwork({ cluster })}
onNext={() => void onNext()}
onNext={() => clusterWizardContext.moveNext()}
onBack={() => clusterWizardContext.moveBack()}
isBackDisabled={isSubmitting || isAutoSaveRunning}
/>
Expand Down
Loading