summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/functions/k8s-profile-upload
diff options
context:
space:
mode:
authorkuldipr <kuldip.rai@amdocs.com>2020-12-03 13:21:59 -0500
committerKAPIL SINGAL <ks220y@att.com>2020-12-04 14:26:39 +0000
commitd6c8cdf8e0edbe1af0f813a4a135ee5f354639e6 (patch)
tree7c49f1a6111283daad3fbc2746cb87650b688c18 /ms/blueprintsprocessor/functions/k8s-profile-upload
parent4e62d2653db35c295e2697398dd3c4278ed56009 (diff)
ResourceResolution should fail if required resource did not resolve
Issue-ID: CCSDK-3022 Signed-off-by: kuldipr <kuldip.rai@amdocs.com> Change-Id: I6ca858988f0b11bdf3bbde07e8f4bde939342aa2 Signed-off-by: kuldipr <kuldip.rai@amdocs.com>
Diffstat (limited to 'ms/blueprintsprocessor/functions/k8s-profile-upload')
-rw-r--r--ms/blueprintsprocessor/functions/k8s-profile-upload/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/profile/upload/K8sProfileUploadComponent.kt9
1 files changed, 7 insertions, 2 deletions
diff --git a/ms/blueprintsprocessor/functions/k8s-profile-upload/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/profile/upload/K8sProfileUploadComponent.kt b/ms/blueprintsprocessor/functions/k8s-profile-upload/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/profile/upload/K8sProfileUploadComponent.kt
index 76b7fae71..23d47dca6 100644
--- a/ms/blueprintsprocessor/functions/k8s-profile-upload/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/profile/upload/K8sProfileUploadComponent.kt
+++ b/ms/blueprintsprocessor/functions/k8s-profile-upload/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/profile/upload/K8sProfileUploadComponent.kt
@@ -25,6 +25,7 @@ import com.fasterxml.jackson.databind.node.ObjectNode
import org.apache.commons.io.FileUtils
import org.onap.ccsdk.cds.blueprintsprocessor.core.BluePrintPropertiesService
import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
+import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionConstants
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.ResourceResolutionService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractComponentFunction
@@ -213,7 +214,7 @@ open class K8sProfileUploadComponent(
properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOURCE_TYPE] = ""
properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_OCCURRENCE] = 1
properties[ResourceResolutionConstants.RESOURCE_RESOLUTION_INPUT_RESOLUTION_SUMMARY] = false
- val resolutionResult: Pair<String, JsonNode> = resourceResolutionService.resolveResources(
+ val resolutionResult: Pair<String, MutableList<ResourceAssignment>> = resourceResolutionService.resolveResources(
bluePrintRuntimeService,
nodeTemplateName,
ks8ProfileSource,
@@ -222,6 +223,10 @@ open class K8sProfileUploadComponent(
val tempMainPath: File = createTempDir("k8s-profile-", "")
val tempProfilePath: File = createTempDir("content-", "", tempMainPath)
+ val resolvedJsonContent = resolutionResult.second
+ .associateBy({ it.name }, { it.property?.value })
+ .asJsonNode()
+
try {
val manifestFiles: ArrayList<File>? = readManifestFiles(
profileSourceFileFolderPath.toFile(),
@@ -229,7 +234,7 @@ open class K8sProfileUploadComponent(
)
if (manifestFiles != null) {
templateLocation(
- profileSourceFileFolderPath.toFile(), resolutionResult.second,
+ profileSourceFileFolderPath.toFile(), resolvedJsonContent,
tempProfilePath, manifestFiles
)
} else