From be3024dfe9b6c06419c6f4a5f724a01b7e0ab103 Mon Sep 17 00:00:00 2001 From: Konrad Bańka Date: Fri, 24 Jan 2020 11:06:14 +0100 Subject: Correct CBA package for vFW_CNF_CDS usecase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes change helm and cba content to enable instantiation with some workarounds. Data dictionary in this review is not ready yet, as well as there are many workarounds within. Signed-off-by: Konrad Bańka Issue-ID: INT-1260 Change-Id: I4833fa11772b7bd2b65d04f0d81ffad22570d309 --- .../templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt') diff --git a/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt b/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt index 02c04415..30a7b72e 100644 --- a/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt +++ b/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt @@ -74,8 +74,10 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { val prefixList: ArrayList = getTemplatePrefixList(executionRequest) for (prefix in prefixList) { - if (prefix.toLowerCase().equals("vnf")) + if (prefix.toLowerCase().equals("vnf")) { + log.info("For vnf-level resource-assignment, profile upload is not performed") continue + } val assignmentParams = getDynamicProperties("assignment-params") val payloadObject = JacksonUtils.jsonNode(assignmentParams.get(prefix).asText()) as ObjectNode @@ -95,7 +97,10 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { log.info("k8s-rb-profile-name: $k8sRbProfileName") if (k8sRbProfileName.equals("")) { - log.info("Profile Name Not Defined - skipping upload") + throw BluePrintProcessorException("K8s rb profile name is empty! Either define profile name to use or choose default") + } + if (k8sRbProfileName.equals("default") and api.hasProfile(k8sRbProfileName)) { + log.info("Using default profile - skipping upload") } else { if (api.hasProfile(k8sRbProfileName)) { log.info("Profile Already Existing - skipping upload") @@ -164,7 +169,7 @@ open class K8sProfileUpload : AbstractScriptComponentFunction() { var basicAuthRestClientProperties: BasicAuthRestClientProperties = BasicAuthRestClientProperties() basicAuthRestClientProperties.username = username basicAuthRestClientProperties.password = password - basicAuthRestClientProperties.url = "$baseUrl/api/multicloud-k8s/v1/v1/rb/definition/${definition}/${definitionVersion}" + basicAuthRestClientProperties.url = "$baseUrl/v1/rb/definition/${definition}/${definitionVersion}" basicAuthRestClientProperties.additionalHeaders = mapOfHeaders this.service = UploadFileRestClientService(basicAuthRestClientProperties) -- cgit 1.2.3-korg