aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-09-17 15:48:43 +0100
committerandre.schmid <andre.schmid@est.tech>2021-09-17 16:19:57 +0100
commitd6b83fce723703f4dea0bce3675ecbf6996aaf9a (patch)
tree4c8e463a3f24cefdd18e3bb28a8573f7fae4f15b /catalog-be/src
parentb3fca719b446b6ad72d723e0043219b249ab5752 (diff)
Fix Update VSP when no version id is provided
Issue-ID: SDC-3730 Change-Id: Ic5a5a6ecf3b6775e022be649145e44b0907cbecf Signed-off-by: andre.schmid <andre.schmid@est.tech>
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb1
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java6
2 files changed, 6 insertions, 1 deletions
diff --git a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
index 60616c2709..118b48d04b 100644
--- a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
+++ b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
@@ -948,6 +948,7 @@ onboarding:
getVspPackageUri: "/onboarding-api/v1.0/vendor-software-products/packages/%s?versionId=%s" # /onboarding-api/v1.0/vendor-software-products/packages/:vspId?versionId=:vspVersionId
getLatestVspPackageUri: "/onboarding-api/v1.0/vendor-software-products/packages/%s" # /onboarding-api/v1.0/vendor-software-products/packages/:vspId
getVspUri: "/onboarding-api/v1.0/vendor-software-products/%s/versions/%s" # /onboarding-api/v1.0/vendor-software-products/:vspId/versions/:vspVersionId
+ getLatestVspUri: "/onboarding-api/v1.0/vendor-software-products/%s" # /onboarding-api/v1.0/vendor-software-products/:vspId
healthCheckUri: "/onboarding-api/v1.0/healthcheck"
# #GSS IDNS
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
index b8a5d67d4a..a85b5542a0 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
@@ -223,7 +223,11 @@ public class CsarBusinessLogic extends BaseBusinessLogic {
private VendorSoftwareProduct getCsar(final Resource resource, final User user) {
final Optional<VendorSoftwareProduct> vendorSoftwareProductOpt;
try {
- vendorSoftwareProductOpt = csarOperation.findVsp(resource.getCsarUUID(), resource.getCsarVersionId(), user);
+ if (resource.getCsarVersionId() == null) {
+ vendorSoftwareProductOpt = csarOperation.findLatestVsp(resource.getCsarUUID(), user);
+ } else {
+ vendorSoftwareProductOpt = csarOperation.findVsp(resource.getCsarUUID(), resource.getCsarVersionId(), user);
+ }
} catch (final Exception exception) {
log.error(EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR, CsarBusinessLogic.class.getName(), exception.getMessage());
auditGetCsarError(resource, user, resource.getCsarUUID(), StorageOperationStatus.GENERAL_ERROR);