From cfc6837e96db3f540505d088c767f5da76d434a3 Mon Sep 17 00:00:00 2001 From: Vijay Venkatesh Kumar Date: Tue, 24 May 2022 17:55:34 -0400 Subject: [MOD/Helm-gen] Add log.path setting for helm-gen Issue-ID: DCAEGEN2-3087 Signed-off-by: Vijay Venkatesh Kumar Change-Id: I0ea4861ba029501b19f3bd811f597dd2949b2d7e Signed-off-by: Vijay Venkatesh Kumar --- mod2/helm-generator/Changelog.md | 3 +++ mod2/helm-generator/README.md | 6 ++---- mod2/helm-generator/helmchartgenerator-cli/pom.xml | 6 +++--- .../src/test/input/blueprint/base/values.yaml | 5 +++-- mod2/helm-generator/helmchartgenerator-core/pom.xml | 4 ++-- .../helmchartgenerator/chartbuilder/ComponentSpecParser.java | 6 ++++-- .../src/test/input/blueprint/base/values.yaml | 5 +++-- .../platform/helmchartgenerator/ComponentSpecParserTest.java | 5 +++-- mod2/helm-generator/pom.xml | 2 +- mod2/helm-generator/version.properties | 2 +- 10 files changed, 25 insertions(+), 19 deletions(-) diff --git a/mod2/helm-generator/Changelog.md b/mod2/helm-generator/Changelog.md index 2dabb70..81c1d59 100644 --- a/mod2/helm-generator/Changelog.md +++ b/mod2/helm-generator/Changelog.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [1.0.4]- 2022-05-24 +* [DCAEGEN2-3087] Helm-gen fix for logpath default + ## [1.0.3]- 2022-02-23 * [DCAEGEN2-3052] Vulnerability fixes for okhttp & commons-io modules diff --git a/mod2/helm-generator/README.md b/mod2/helm-generator/README.md index d797410..5d8f003 100644 --- a/mod2/helm-generator/README.md +++ b/mod2/helm-generator/README.md @@ -1,5 +1,5 @@ ## Instructions for running helm chart generator -version: 1.0.2-SNAPSHOT +version: 1.0.4-SNAPSHOT 1. Must have helm installed. @@ -25,6 +25,4 @@ version: 1.0.2-SNAPSHOT Test files currently included in project: - Spec file: `helm-chart-generator\src\test\input\specs\ves.json` - - Charts Directory: `helm-chart-generator\src\test\input\blueprint` - - gi \ No newline at end of file + - Charts Directory: `helm-chart-generator\src\test\input\blueprint` diff --git a/mod2/helm-generator/helmchartgenerator-cli/pom.xml b/mod2/helm-generator/helmchartgenerator-cli/pom.xml index 3229e94..3b85801 100644 --- a/mod2/helm-generator/helmchartgenerator-cli/pom.xml +++ b/mod2/helm-generator/helmchartgenerator-cli/pom.xml @@ -22,10 +22,10 @@ org.onap.dcaegen2.platform helmchartgenerator - 1.0.3-SNAPSHOT + 1.0.4-SNAPSHOT helmchartgenerator-cli - 1.0.3-SNAPSHOT + 1.0.4-SNAPSHOT helmchartgenerator-cli UTF-8 @@ -34,7 +34,7 @@ org.onap.dcaegen2.platform helmchartgenerator-core - 1.0.3-SNAPSHOT + 1.0.4-SNAPSHOT diff --git a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml index ea82bbe..cd4c1bf 100644 --- a/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml +++ b/mod2/helm-generator/helmchartgenerator-cli/src/test/input/blueprint/base/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2021-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,7 +50,8 @@ postgres: # log directory where logging sidecar should look for log files # if absent, no sidecar will be deployed -#logDirectory: TBD #/opt/app/VESCollector/logs #DONE +#log: +# path: TBD #/opt/app/VESCollector/logs #DONE # directory where TLS certs should be stored # if absent, no certs will be retrieved and stored diff --git a/mod2/helm-generator/helmchartgenerator-core/pom.xml b/mod2/helm-generator/helmchartgenerator-core/pom.xml index 1b9dc35..1b5dcb2 100644 --- a/mod2/helm-generator/helmchartgenerator-core/pom.xml +++ b/mod2/helm-generator/helmchartgenerator-core/pom.xml @@ -22,10 +22,10 @@ org.onap.dcaegen2.platform helmchartgenerator - 1.0.3-SNAPSHOT + 1.0.4-SNAPSHOT helmchartgenerator-core - 1.0.3-SNAPSHOT + 1.0.4-SNAPSHOT helmchartgenerator-core UTF-8 diff --git a/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ComponentSpecParser.java b/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ComponentSpecParser.java index 82d70c8..91fedf5 100644 --- a/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ComponentSpecParser.java +++ b/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ComponentSpecParser.java @@ -1,6 +1,6 @@ /* * # ============LICENSE_START======================================================= - * # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + * # Copyright (c) 2021-2022 AT&T Intellectual Property. All rights reserved. * # ================================================================================ * # Licensed under the Apache License, Version 2.0 (the "License"); * # you may not use this file except in compliance with the License. @@ -96,7 +96,9 @@ public class ComponentSpecParser { utils.putIfNotNull(outerValues, "tlsServer", cs.getAuxilary().getTlsInfo().getUseTls()); } if(cs.getAuxilary() != null && cs.getAuxilary().getLogInfo() != null) { - utils.putIfNotNull(outerValues,"logDirectory", cs.getAuxilary().getLogInfo().get("log_directory")); + Map logPath = new LinkedHashMap<>(); + logPath.put("path", cs.getAuxilary().getLogInfo().get("log_directory")); + outerValues.put("log", logPath); } if(imageUriExistsForFirstArtifact(cs)){ utils.putIfNotNull(outerValues,"image", cs.getArtifacts()[0].getUri()); diff --git a/mod2/helm-generator/helmchartgenerator-core/src/test/input/blueprint/base/values.yaml b/mod2/helm-generator/helmchartgenerator-core/src/test/input/blueprint/base/values.yaml index ea82bbe..cd4c1bf 100644 --- a/mod2/helm-generator/helmchartgenerator-core/src/test/input/blueprint/base/values.yaml +++ b/mod2/helm-generator/helmchartgenerator-core/src/test/input/blueprint/base/values.yaml @@ -1,5 +1,5 @@ # ============LICENSE_START======================================================= -# Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. +# Copyright (c) 2021-2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -50,7 +50,8 @@ postgres: # log directory where logging sidecar should look for log files # if absent, no sidecar will be deployed -#logDirectory: TBD #/opt/app/VESCollector/logs #DONE +#log: +# path: TBD #/opt/app/VESCollector/logs #DONE # directory where TLS certs should be stored # if absent, no certs will be retrieved and stored diff --git a/mod2/helm-generator/helmchartgenerator-core/src/test/java/org/onap/dcaegen2/platform/helmchartgenerator/ComponentSpecParserTest.java b/mod2/helm-generator/helmchartgenerator-core/src/test/java/org/onap/dcaegen2/platform/helmchartgenerator/ComponentSpecParserTest.java index 8b26d25..e7d8cf2 100644 --- a/mod2/helm-generator/helmchartgenerator-core/src/test/java/org/onap/dcaegen2/platform/helmchartgenerator/ComponentSpecParserTest.java +++ b/mod2/helm-generator/helmchartgenerator-core/src/test/java/org/onap/dcaegen2/platform/helmchartgenerator/ComponentSpecParserTest.java @@ -1,6 +1,6 @@ /* * # ============LICENSE_START======================================================= - * # Copyright (c) 2021 AT&T Intellectual Property. All rights reserved. + * # Copyright (c) 2021-2022 AT&T Intellectual Property. All rights reserved. * # ================================================================================ * # Licensed under the Apache License, Version 2.0 (the "License"); * # you may not use this file except in compliance with the License. @@ -78,7 +78,8 @@ class ComponentSpecParserTest { private void assertOuterKeyValues(ChartInfo chartInfo) { Map outerKv = chartInfo.getValues(); assertThat(outerKv.get("image")).isEqualTo("nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.ves.vescollector:latest"); - assertThat(outerKv.get("logDirectory")).isEqualTo("/opt/app/VESCollector/logs/"); + Map logPath = (Map) chartInfo.getValues().get("log"); + assertThat(logPath.get("path")).isEqualTo("/opt/app/VESCollector/logs/"); assertThat(outerKv.get("certDirectory")).isEqualTo("/opt/app/dcae-certificate/"); assertTrue((Boolean) outerKv.get("tlsServer")); assertTrue((Boolean) outerKv.get("useCmpv2Certificates")); diff --git a/mod2/helm-generator/pom.xml b/mod2/helm-generator/pom.xml index 1b6d211..2c7060b 100644 --- a/mod2/helm-generator/pom.xml +++ b/mod2/helm-generator/pom.xml @@ -33,7 +33,7 @@ org.onap.dcaegen2.platform helmchartgenerator - 1.0.3-SNAPSHOT + 1.0.4-SNAPSHOT helm-chart-generator Helm chart generator diff --git a/mod2/helm-generator/version.properties b/mod2/helm-generator/version.properties index ab6cbfe..8bd09ad 100644 --- a/mod2/helm-generator/version.properties +++ b/mod2/helm-generator/version.properties @@ -1,6 +1,6 @@ major=1 minor=0 -patch=3 +patch=4 base_version=${major}.${minor}.${patch} release_version=${base_version} snapshot_version=${base_version}-SNAPSHOT -- cgit 1.2.3-korg