From 7d17ee81e257b6e74f4c75279e9488d154904313 Mon Sep 17 00:00:00 2001 From: Lukasz Rajewski Date: Wed, 13 Apr 2022 20:49:52 +0200 Subject: Closing artifact files after vtl templating Issue-ID: CCSDK-3631 Signed-off-by: Lukasz Rajewski Change-Id: I20972afeebafbc0ea47ee22c2ba9b32d760ebbb5 --- .../functions/k8s/definition/profile/K8sProfileUploadComponent.kt | 2 +- .../functions/k8s/definition/template/K8sConfigTemplateComponent.kt | 2 +- .../functions/k8s/definition/template/K8sConfigValueComponent.kt | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'ms/blueprintsprocessor/functions/k8s-connection-plugin') diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt index 80e1cb4f1..e7d781d7b 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/profile/K8sProfileUploadComponent.kt @@ -372,7 +372,7 @@ open class K8sProfileUploadComponent( ) if (!isFileInTheManifestFiles(finalFile, manifestFiles)) return - val fileContent = templatedFile.bufferedReader().readText() + val fileContent = Files.readString(templatedFile.toPath()) val finalFileContent = BluePrintVelocityTemplateService.generateContent( fileContent, params.toString(), true diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt index cd58baf83..591b3de26 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigTemplateComponent.kt @@ -259,7 +259,7 @@ open class K8sConfigTemplateComponent( private fun templateFile(templateFile: File, params: JsonNode, destinationFolder: File) { val finalFile = File(destinationFolder.path.plus(File.separator).plus(templateFile.nameWithoutExtension)) - val fileContent = templateFile.bufferedReader().readText() + val fileContent = Files.readString(templateFile.toPath()) val finalFileContent = BluePrintVelocityTemplateService.generateContent( fileContent, params.toString(), true diff --git a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt index 0b6294936..90f59c458 100644 --- a/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt +++ b/ms/blueprintsprocessor/functions/k8s-connection-plugin/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/functions/k8s/definition/template/K8sConfigValueComponent.kt @@ -27,6 +27,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory import org.springframework.context.annotation.Scope import org.springframework.stereotype.Component import java.io.File +import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths @@ -252,7 +253,7 @@ open class K8sConfigValueComponent( } private fun templateValues(templateFile: File, params: JsonNode): String { - val fileContent = templateFile.bufferedReader().readText() + val fileContent = Files.readString(templateFile.toPath()) return BluePrintVelocityTemplateService.generateContent( fileContent, params.toString(), true -- cgit 1.2.3-korg