diff options
author | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2022-04-13 20:49:52 +0200 |
---|---|---|
committer | Lukasz Rajewski <lukasz.rajewski@orange.com> | 2022-04-13 20:49:52 +0200 |
commit | 7d17ee81e257b6e74f4c75279e9488d154904313 (patch) | |
tree | 5287f757273d222ee79a6aae7dc62bd29e87aee2 /ms/blueprintsprocessor/functions/k8s-connection-plugin | |
parent | 221223e7d0689e5d43d72acba112f95589b51892 (diff) |
Closing artifact files after vtl templating
Issue-ID: CCSDK-3631
Signed-off-by: Lukasz Rajewski <lukasz.rajewski@orange.com>
Change-Id: I20972afeebafbc0ea47ee22c2ba9b32d760ebbb5
Diffstat (limited to 'ms/blueprintsprocessor/functions/k8s-connection-plugin')
3 files changed, 4 insertions, 3 deletions
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 |