use of org.eclipse.che.workspace.infrastructure.kubernetes.KubernetesInfrastructureException in project devspaces-images by redhat-developer.
the class OpenShiftProject method delete.
/**
* Deletes the project. Deleting a non-existent projects is not an error as is not an attempt to
* delete a project that is already being deleted.
*
* @throws InfrastructureException if any unexpected exception occurs during project deletion
*/
void delete() throws InfrastructureException {
String workspaceId = getWorkspaceId();
String projectName = getName();
OpenShiftClient osClient = clientFactory.createOC(workspaceId);
try {
delete(projectName, osClient);
} catch (KubernetesClientException e) {
if (e.getCode() == 403) {
throw new InfrastructureException(format("Could not access the project %s when deleting it for workspace %s", projectName, workspaceId), e);
}
throw new KubernetesInfrastructureException(e);
}
}
Aggregations