From 372c2470e613128f1e33cfc581ea2c5b1b732d2b Mon Sep 17 00:00:00 2001 From: Jan Malkiewicz Date: Tue, 9 Feb 2021 08:39:23 +0100 Subject: Add validation of manifest for helm packages. For ONAP native zip packages added validation of manifest file. HELM package is only valid if: * isBase flag is set to 'true' for exactly one helm entry * isBase flag is present for all helm entries Zip package is considered to be a helm package if it contains HELM entries but does not contain any HEAT entries (however it may contains entries of other types). Refactored method OnboardingPackageProcessor.processPackage(): * simplified logic * enhanced exception handling Issue-ID: SDC-3185 Signed-off-by: Jan Malkiewicz Change-Id: Ica3b1f1504ce4fc3a671c4b8fa8de2bf0236bd77 --- .../sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openecomp-be/api') diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java index c331deb134..073400fd68 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java @@ -1,5 +1,6 @@ /* * Copyright © 2016-2018 European Support Limited + * Copyright © 2021 Nokia * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -104,7 +105,7 @@ public class OrchestrationTemplateCandidateImpl implements OrchestrationTemplate final OnboardingPackageProcessor onboardingPackageProcessor = new OnboardingPackageProcessor(filename, fileToUploadBytes); if (onboardingPackageProcessor.hasErrors()) { final UploadFileResponseDto uploadFileResponseDto = - buildUploadResponseWithError(onboardingPackageProcessor.getErrorMessageSet().toArray(new ErrorMessage[0])); + buildUploadResponseWithError(onboardingPackageProcessor.getErrorMessages().toArray(new ErrorMessage[0])); return Response.ok(uploadFileResponseDto).build(); } -- cgit 1.2.3-korg