@Override
	public void postHook(WorkflowContext context) throws HyscaleException {
		String serviceName = context.getServiceName();
		String appName = context.getAppName();
		String namespace = context.getNamespace();
		String envName = context.getEnvName();

		ApiClient apiClient = clientProvider.get((K8sAuthorisation) context.getAuthConfig());

		V1PersistentVolumeClaimHandler pvcHandler = (V1PersistentVolumeClaimHandler) ResourceHandlers
				.getHandlerOf(ResourceKind.PERSISTENT_VOLUME_CLAIM.getKind());

		String selector = ResourceSelectorUtil.getSelector(appName, envName, serviceName);

		List<V1PersistentVolumeClaim> pvcItemsList = pvcHandler.getBySelector(apiClient, selector, true, namespace);
		if (pvcItemsList == null || pvcItemsList.isEmpty()) {
			return;
		}

		Map<String, Set<String>> serviceVsVolumes = KubernetesVolumeUtil.getServiceVolumeNames(pvcItemsList);

		Map<String, Set<String>> serviceVsPVC = KubernetesVolumeUtil.getServicePVCs(pvcItemsList);

		serviceVsVolumes.entrySet().stream().forEach(entity -> {
			WorkflowLogger.persist(DeployerActivity.STALE_VOLUME_REUSE, entity.getValue().toString(), namespace,
					serviceVsPVC.get(entity.getKey()).toString(), entity.getKey());
		});
	}
Get PVCs
Mark all pvcs as stale resources
workflow-controller/controller-service/src/main/java/io/hyscale/controller/hooks/StaleVolumeDetailsHook.java