Skip to content
Merged
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
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import React from 'react';
import { Button, ButtonVariant, Content, Stack, StackItem, Alert } from '@patternfly/react-core';
import { Modal, ModalVariant } from '@patternfly/react-core/deprecated';
import {
useModalDialogsContext,
ClustersService,
HostsService,
} from '@openshift-assisted/ui-lib/ocm';
import { useModalDialogsContext, ClustersService } from '@openshift-assisted/ui-lib/ocm';
import {
getApiErrorMessage,
handleApiError,
Expand Down Expand Up @@ -35,14 +31,6 @@ const ResetSingleClusterModal: React.FC = () => {
try {
setError(undefined);
setIsLoading(true);
const hosts = cluster?.hosts;
if (hosts) {
for (const host of hosts) {
await HostsService.unbind(host);
}
}

// Remove the regular cluster
await ClustersService.remove(cluster.id);
navigate(`/`);
} catch (e) {
Expand Down
5 changes: 0 additions & 5 deletions libs/ui-lib/lib/common/api/assisted-service/HostsAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ const HostsAPI = {
},
);
},
unbindHost(infraEnvId: InfraEnv['id'], hostId: Host['id']) {
return client.post<Host, AxiosResponse<Host>, never>(
`${HostsAPI.makeActionsBaseURI(infraEnvId, hostId)}/unbind`,
);
},
};

export default HostsAPI;
8 changes: 0 additions & 8 deletions libs/ui-lib/lib/ocm/services/HostsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,6 @@ const HostsService = {
return HostsAPI.bindHost(host.infraEnvId, host.id, clusterId);
},

unbind(host: Host) {
if (!host.infraEnvId) {
throw new Error(`Cannot unbind host ${host.id}, missing infraEnvId`);
}

return HostsAPI.unbindHost(host.infraEnvId, host.id);
},

installAll(hosts: Host[]) {
const promises = [];
for (const host of hosts) {
Expand Down
Loading