private void deleteResources(String labelSelector, List<CustomResourceKind> appliedKindsList) throws HyscaleException {
        boolean resourcesDeleted = true;

        List<String> failedResources = new ArrayList<>();
        if (appliedKindsList != null && !appliedKindsList.isEmpty()) {
            for (CustomResourceKind customResource : appliedKindsList) {
                logger.info("Cleaning up - {}", customResource.getKind());
                GenericK8sClient genericK8sClient = new K8sResourceClient(apiClient).
                        withNamespace(namespace).forKind(customResource);
                List<CustomObject> resources = genericK8sClient.getBySelector(labelSelector);
                if (resources == null || resources.isEmpty()) {
                    continue;
                }
                WorkflowLogger.startActivity(DeployerActivity.DELETING, customResource.getKind());
                for (CustomObject resource : resources) {
                    resource.put("kind", customResource.getKind());
                    boolean result = genericK8sClient.delete(resource);
                    logger.debug("Undeployment status for resource {} is {}", customResource.getKind(), result);
                    resourcesDeleted = resourcesDeleted && result;
                }
                if (resourcesDeleted) {
                    WorkflowLogger.endActivity(Status.DONE);
                } else {
                    failedResources.add(customResource.getKind());
                    WorkflowLogger.endActivity(Status.FAILED);
                }
            }
        } else if (!failedResources.isEmpty()) {
            String[] args = new String[failedResources.size()];
            failedResources.toArray(args);
            throw new HyscaleException(DeployerErrorCodes.FAILED_TO_DELETE_RESOURCE, args);
        } else {
            WorkflowLogger.info(DeployerActivity.NO_RESOURCES_TO_UNDEPLOY);
        }
    }
Undeploy resources from cluster
Deletes all resources in a service

@param appName
@param serviceName
@throws HyscaleException if failed to delete any resource
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/util/K8sResourceDispatcher.java