summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java
diff options
context:
space:
mode:
authorYuli Shlosberg <ys9693@att.com>2020-05-05 12:45:46 +0300
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-05-06 06:44:15 +0000
commita02add03b465de2adf8f5b05cf9d428af914287f (patch)
treec1f1ec12243060c34bc89ff0aa69c796e9d63e70 /catalog-be/src/main/java
parent339d29c714f60de6e4e50b883259fc1a9a16ee84 (diff)
fix bug - Unable to link CSAR artifact
Change-Id: I586637f988b84b3b858e2c8d567c6844be38322b Issue-ID: SDC-2972 Signed-off-by: Yuli Shlosberg <ys9693@att.com>
Diffstat (limited to 'catalog-be/src/main/java')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
index 93e31e2ea2..da9e0f9444 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ComponentInstanceBusinessLogic.java
@@ -665,7 +665,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
protected ActionStatus addComponentInstanceArtifacts(org.openecomp.sdc.be.model.Component containerComponent, ComponentInstance componentInstance, org.openecomp.sdc.be.model.Component originComponent, User user, Map<String, String> existingEnvVersions) {
log.debug("add artifacts to resource instance");
- List<GroupDefinition> filteredGroups = null;
+ List<GroupDefinition> filteredGroups = new ArrayList<>();
ActionStatus status = setResourceArtifactsOnResourceInstance(componentInstance);
if (ActionStatus.OK != status) {
throw new ByResponseFormatComponentException(componentsUtils.getResponseFormatForResourceInstance(status, "", null));
@@ -679,6 +679,7 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
Map<String, List<ArtifactDefinition>> groupInstancesArtifacts = new HashMap<>();
Integer defaultHeatTimeout = ConfigurationManager.getConfigurationManager().getConfiguration()
.getHeatArtifactDeploymentTimeout().getDefaultMinutes();
+ List<ArtifactDefinition> listOfCloudSpecificArts = new ArrayList<>();
for (ArtifactDefinition artifact : componentDeploymentArtifacts.values()) {
String type = artifact.getArtifactType();
if (!type.equalsIgnoreCase(ArtifactTypeEnum.HEAT_ENV.getType())) {
@@ -700,6 +701,9 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
if (CollectionUtils.isNotEmpty(originComponent.getGroups())) {
filteredGroups = originComponent.getGroups().stream().filter(g -> g.getType().equals(VF_MODULE)).collect(Collectors.toList());
}
+ if (isCloudSpecificArtifact(artifactDefinition.getArtifactName())) {
+ listOfCloudSpecificArts.add(artifact);
+ }
if (CollectionUtils.isNotEmpty(filteredGroups)) {
filteredGroups.stream().filter(g ->
g.getArtifacts()
@@ -710,6 +714,11 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
}
}
}
+ groupInstancesArtifacts.forEach((k,v) -> v.addAll(listOfCloudSpecificArts));
+ filteredGroups.forEach(g -> listOfCloudSpecificArts.forEach((e) -> {
+ g.getArtifactsUuid().add(e.getArtifactUUID());
+ g.getArtifacts().add(e.getUniqueId());
+ }));
artStatus = toscaOperationFacade.addDeploymentArtifactsToInstance(containerComponent.getUniqueId(), componentInstance, finalDeploymentArtifacts);
if (artStatus != StorageOperationStatus.OK) {
log.debug("Failed to add instance deployment artifacts for instance {} in conatiner {} error {}", componentInstance.getUniqueId(), containerComponent.getUniqueId(), artStatus);
@@ -743,9 +752,6 @@ public class ComponentInstanceBusinessLogic extends BaseBusinessLogic {
}
artifactsUid.add(artifactDefinition);
groupInstancesArtifacts.put(groupInstance.getUniqueId(), artifactsUid);
- if (isCloudSpecificArtifact(artifactDefinition.getArtifactName())) {
- groupInstance.getArtifacts().add(artifactDefinition.getGeneratedFromId());
- }
}
private ActionStatus setResourceArtifactsOnResourceInstance(ComponentInstance resourceInstance) {