aboutsummaryrefslogtreecommitdiffstats
path: root/heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt
diff options
context:
space:
mode:
authorKonrad Bańka <k.banka@samsung.com>2020-01-24 11:06:14 +0100
committerKonrad Bańka <k.banka@samsung.com>2020-02-26 16:16:41 +0100
commitbe3024dfe9b6c06419c6f4a5f724a01b7e0ab103 (patch)
treedf44d4b265d40fd225844485c1de860c13d9966a /heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt
parent42ecc70c1f5a05c4de5dda414a7964398552b47d (diff)
Correct CBA package for vFW_CNF_CDS usecase
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 <k.banka@samsung.com> Issue-ID: INT-1260 Change-Id: I4833fa11772b7bd2b65d04f0d81ffad22570d309
Diffstat (limited to 'heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt')
-rw-r--r--heat/vFW_CNF_CDS/templates/cba/Scripts/kotlin/KotlinK8sProfileUpload.kt11
1 files changed, 8 insertions, 3 deletions
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<String> = 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)