From f27bba9ad6e8afe8306cdcc4af4f595b1cfff49d Mon Sep 17 00:00:00 2001 From: davsad Date: Mon, 29 Mar 2021 14:20:02 +0100 Subject: Fix restricting valid values for ONAP service metadata Issue-ID: SDC-3539 Signed-off-by: davsad Change-Id: I10658e29bc986f9fd9c5d5d6ce34d0bd02d70e11 --- .../src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'catalog-be/src/main/java/org/openecomp') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java index efb3f49d03..10d2130792 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java @@ -151,6 +151,7 @@ public class ToscaExportHandler { private static final String FAILED_TO_GET_DEFAULT_IMPORTS_CONFIGURATION = "convertToToscaTemplate - failed to get Default Imports section from configuration"; private static final String NOT_SUPPORTED_COMPONENT_TYPE = "Not supported component type {}"; private static final String NATIVE_ROOT = "tosca.nodes.Root"; + private static final List EXCLUDED_CATEGORY_SPECIFIC_METADATA = List.of("Service Function", "Service Role", "Naming Policy", "Service Type"); private static final YamlUtil yamlUtil = new YamlUtil(); private ApplicationDataTypeCache dataTypeCache; private ToscaOperationFacade toscaOperationFacade; @@ -482,7 +483,8 @@ public class ToscaExportHandler { log.debug(NOT_SUPPORTED_COMPONENT_TYPE, component.getComponentType()); } for (final String key : component.getCategorySpecificMetadata().keySet()) { - toscaMetadata.put(key, component.getCategorySpecificMetadata().get(key)); + if (!EXCLUDED_CATEGORY_SPECIFIC_METADATA.contains(key)) + toscaMetadata.put(key, component.getCategorySpecificMetadata().get(key)); } return toscaMetadata; } -- cgit 1.2.3-korg