import org.onap.ccsdk.cds.blueprintsprocessor.functions.k8s.definition.template.K8sConfigValueComponent
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor
import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment
import org.slf4j.LoggerFactory
val moduleData: ObjectNode = objectMapper.createObjectNode()
result.put(label, moduleData)
moduleData.put(K8sConfigTemplateComponent.INPUT_K8S_DEFINITION_NAME, modelInfo["model-invariant-uuid"].asText())
- moduleData.put(K8sConfigTemplateComponent.INPUT_K8S_DEFINITION_VERSION, modelInfo["model-uuid"].asText())
+ moduleData.put(K8sConfigTemplateComponent.INPUT_K8S_DEFINITION_VERSION, modelInfo["model-customization-uuid"].asText())
val templateName: String? = getParamValueByName(moduleParameters, K8sConfigTemplateComponent.INPUT_K8S_TEMPLATE_NAME)
val templateSource: String? = getParamValueByName(moduleParameters, K8sConfigTemplateComponent.INPUT_K8S_TEMPLATE_SOURCE)
val configValueSource: String? = getParamValueByName(moduleParameters, K8sConfigValueComponent.INPUT_K8S_CONFIG_VALUE_SOURCE)
moduleData.put(K8sConfigValueComponent.INPUT_K8S_RB_CONFIG_NAME, configName)
for (aaiModule in modulesAai) {
- if (aaiModule["vf-module-id"].asText() == module["vf-module-id"].asText()) {
+ if (aaiModule["vf-module-id"].asText() == module["vf-module-id"].asText() && aaiModule["heat-stack-id"] != null) {
moduleData.put(K8sConfigValueComponent.INPUT_K8S_INSTANCE_ID, aaiModule["heat-stack-id"].asText())
break
}
log.error(e.message, e)
ResourceAssignmentUtils.setResourceDataValue(executionRequest, raRuntimeService, "ERROR")
- throw BlueprintProcessorException("Failed in template key ($executionRequest) assignments, cause: ${e.message}", e)
+ throw BluePrintProcessorException("Failed in template key ($executionRequest) assignments, cause: ${e.message}", e)
}
}
private fun getParamValueByName(params: JsonNode, paramName: String): String? {
for (param in params) {
- if (param["name"].asText() == paramName) {
+ if (param["name"].asText() == paramName && param["value"].asText() != "null") {
return param["value"].asText()
}
}