From e493d4ff662d6f7bf0c7adbc58c356beb2fe2dce Mon Sep 17 00:00:00 2001 From: Sithara Nambiar Date: Sun, 16 Aug 2020 22:28:48 +0530 Subject: SDC changes for adding helm Issue-ID: REQ-341 Signed-off-by: Sithara Nambiar Change-Id: I4721f6e8e2690dc5f7c10bb7b1b2f53ec5f318c7 --- .../sdc-catalog-be/templates/default/BE-configuration.yaml.erb | 9 +++++++++ catalog-be/src/main/resources/config/configuration.yaml | 7 +++++++ .../src/test/resources/config/catalog-be/configuration.yaml | 9 +++++++++ .../java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java | 1 + .../org/openecomp/sdc/heat/datatypes/manifest/FileData.java | 1 + .../ManifestCreatorNamingConventionImpl.java | 10 +++++++++- 6 files changed, 36 insertions(+), 1 deletion(-) diff --git a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb index d7a2d667ee..830ba40e66 100644 --- a/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb +++ b/catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb @@ -206,6 +206,15 @@ artifacts: - PNF acceptedTypes: - zip + - type: HELM + categories: + - DEPLOYMENT + componentTypes: + - SERVICE + - RESOURCE + resourceTypes: *allResourceTypes + acceptedTypes: + - tgz - type: YANG_XML categories: - DEPLOYMENT diff --git a/catalog-be/src/main/resources/config/configuration.yaml b/catalog-be/src/main/resources/config/configuration.yaml index 3e34e2176f..ab89d8f158 100644 --- a/catalog-be/src/main/resources/config/configuration.yaml +++ b/catalog-be/src/main/resources/config/configuration.yaml @@ -301,6 +301,9 @@ serviceDeploymentArtifacts: CONTROLLER_BLUEPRINT_ARCHIVE: acceptedTypes: - zip + HELM: + acceptedTypes: + - tgz YANG_XML: acceptedTypes: - xml @@ -498,6 +501,10 @@ resourceDeploymentArtifacts: validForResourceTypes: - VF - PNF + HELM: + acceptedTypes: + - tgz + validForResourceTypes: *allResourceTypes CONTROLLER_BLUEPRINT_ARCHIVE: acceptedTypes: - zip diff --git a/catalog-be/src/test/resources/config/catalog-be/configuration.yaml b/catalog-be/src/test/resources/config/catalog-be/configuration.yaml index 0065d7b8a8..bf6176fd25 100644 --- a/catalog-be/src/test/resources/config/catalog-be/configuration.yaml +++ b/catalog-be/src/test/resources/config/catalog-be/configuration.yaml @@ -566,6 +566,15 @@ artifacts: - PNF acceptedTypes: - zip + - type: HELM + categories: + - DEPLOYMENT + componentTypes: + - SERVICE + - RESOURCE + resourceTypes: *allResourceTypes + acceptedTypes: + - tgz - type: YANG_XML categories: - DEPLOYMENT diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java b/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java index 94d9a8ed73..6a8b405125 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java @@ -44,6 +44,7 @@ public enum ArtifactTypeEnum { CHEF("CHEF"), CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT("CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"), CONTROLLER_BLUEPRINT_ARCHIVE("CONTROLLER_BLUEPRINT_ARCHIVE"), + HELM("HELM"), DCAE_DOC("DCAE_DOC"), DCAE_EVENT("DCAE_EVENT"), DCAE_INVENTORY_BLUEPRINT("DCAE_INVENTORY_BLUEPRINT"), diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java index 264052386d..8b4eebde0e 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java @@ -95,6 +95,7 @@ public class FileData { VF_LICENSE("VF_LICENSE"), CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT("CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT"), CONTROLLER_BLUEPRINT_ARCHIVE("CONTROLLER_BLUEPRINT_ARCHIVE"), + HELM("HELM"), OTHER("OTHER"), PNF_SW_INFORMATION("PNF_SW_INFORMATION"); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java index cac846294f..539e98df5a 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/ManifestCreatorNamingConventionImpl.java @@ -41,6 +41,7 @@ public class ManifestCreatorNamingConventionImpl implements ManifestCreator { private static final String[][] CLOUD_SPECIFIC_KEY_WORDS = {{"k8s", "azure", "aws"}, /* cloud specific technology */ {"charts", "day0", "configtemplate"} /*cloud specific sub type*/}; private static final String CONTROLLER_BLUEPRINT_ARCHIVE_FIXED_KEY_WORD = "CBA"; + private static final String HELM_KEY_WORD = "HELM"; @Override public Optional createManifest( @@ -155,6 +156,10 @@ public class ManifestCreatorNamingConventionImpl implements ManifestCreator { return artifact.toUpperCase().contains(CONTROLLER_BLUEPRINT_ARCHIVE_FIXED_KEY_WORD); } + private boolean isHelm(String artifact) { + return artifact.toUpperCase().contains(HELM_KEY_WORD); + } + private void addArtifactsToManifestFileDataList( FilesDataStructure filesDataStructure, List fileDataList) { Collection forArtifacts = CollectionUtils @@ -165,7 +170,10 @@ public class ManifestCreatorNamingConventionImpl implements ManifestCreator { fileDataList.add(createBaseFileData(FileData.Type.CLOUD_TECHNOLOGY_SPECIFIC_ARTIFACT, artifact)); } else if (isControllerBlueprintArchive(artifact)) { fileDataList.add(createBaseFileData(FileData.Type.CONTROLLER_BLUEPRINT_ARCHIVE, artifact)); - } else { + } else if (isHelm(artifact)) { + fileDataList.add(createBaseFileData(FileData.Type.HELM, artifact)); + } + else { fileDataList.add(createBaseFileData(FileData.Type.OTHER, artifact)); } } -- cgit 1.2.3-korg