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 --- .../src/main/java/org/openecomp/sdc/common/errors/Messages.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'openecomp-be/lib/openecomp-common-lib') diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java index cf34984fe0..ab088a4dda 100644 --- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java @@ -33,6 +33,7 @@ public enum Messages { PACKAGE_PROCESS_INTERNAL_PACKAGE_ERROR("Could not process internal package '%s'"), PACKAGE_INVALID_ERROR("Invalid package content '%s'"), PACKAGE_MISSING_INTERNAL_PACKAGE("Missing expected internal package"), + COULD_NOT_READ_MANIFEST_FILE("Could not read manifest file: %s [%s]"), INVALID_ZIP_FILE("Invalid zip file"), INVALID_CSAR_FILE("Invalid csar file"), CSAR_FILE_NOT_FOUND("Each CSAR file must contain %s file."), @@ -71,6 +72,9 @@ public enum Messages { MANIFEST_ERROR_WITH_LINE("%s;%nAt line %s: '%s'."), MANIFEST_PARSER_INTERNAL("Invalid manifest file"), MANIFEST_UNEXPECTED_ERROR("An unexpected error occurred while validating manifest '%s': %s"), + MANIFEST_VALIDATION_HELM_IS_BASE_MISSING("Definition of 'isBase' is missing in %d charts."), + MANIFEST_VALIDATION_HELM_IS_BASE_NOT_UNIQUE("More than one chart is marked as 'isBase'."), + MANIFEST_VALIDATION_HELM_IS_BASE_NOT_SET("None of charts is marked as 'isBase'."), METADATA_PARSER_INTERNAL("Invalid Metadata file"), METADATA_MISSING_OPTIONAL_FOLDERS("Missing folder %s in package"), METADATA_UNSUPPORTED_ENTRY("Following entry not supported in TOSCA.meta %s"), -- cgit 1.2.3-korg