public List<AppMetadata> build(List<PodParent> podParentList) {
        Map<String, AppMetadata> mapping = new HashMap<>();

        podParentList.forEach(podParent -> {
            V1ObjectMeta metadata = null;
            
            if (ResourceKind.DEPLOYMENT.getKind().equalsIgnoreCase(podParent.getKind())) {
                metadata = ((V1Deployment)podParent.getParent()).getMetadata();
            }
            if (ResourceKind.STATEFUL_SET.getKind().equalsIgnoreCase(podParent.getKind())) {
                metadata = ((V1StatefulSet)podParent.getParent()).getMetadata();
            }
            String namespace = metadata.getNamespace();
            String appName = ResourceLabelUtil.getAppName(metadata.getLabels());
            String serviceName = ResourceLabelUtil.getServiceName(metadata.getLabels());
            String envName = ResourceLabelUtil.getEnvName(metadata.getLabels());

            if (mapping.get(namespace) == null) {
                AppMetadata appData = new AppMetadata();
                appData.setNamespace(namespace);
                mapping.put(namespace, appData);
            }
            if (StringUtils.isBlank(appName) || StringUtils.isBlank(serviceName)) {
                return;
            }
            // One namespace can have only one app
            mapping.get(namespace).setAppName(appName);
            if (StringUtils.isNotBlank(envName)) {
                mapping.get(namespace).setEnvName(envName);
            }
            if (mapping.get(namespace).getServices() == null
                    || !mapping.get(namespace).getServices().contains(serviceName)) {
                mapping.get(namespace).addServices(serviceName);
            }
        });
        
        return mapping.values().stream().collect(Collectors.toList());
    }
Gets app and service name from labels of pod parent generated by hyscale
For pod controller not deployed with hyscale AppMetadata with only namespace will be returned
@param podParentList
@return List of {@link AppMetadata} containing details of deployed apps
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/builder/AppMetadataBuilder.java