X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=mod2%2Fhelm-generator%2Fhelmchartgenerator-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdcaegen2%2Fplatform%2Fhelmchartgenerator%2Fchartbuilder%2FChartGenerator.java;h=c884e4715eeda43c2906bf4b88bcc1bf9f9d77dc;hb=f98abd8de6b9457a7edcd3457e664bd9200de2bf;hp=be02d68df20cd5f22f54c71e538dbb5fc1b078c4;hpb=0bae36245d468db7232bedc896f7d26681b14e03;p=dcaegen2%2Fplatform.git diff --git a/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ChartGenerator.java b/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ChartGenerator.java index be02d68..c884e47 100644 --- a/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ChartGenerator.java +++ b/mod2/helm-generator/helmchartgenerator-core/src/main/java/org/onap/dcaegen2/platform/helmchartgenerator/chartbuilder/ChartGenerator.java @@ -43,16 +43,21 @@ public class ChartGenerator { @Autowired private Utils utils; + @Autowired + private AddOnsManager addOnsManager; + /** * Constructor for ChartGenerator * @param helmClient HelmClient implementation * @param merger KeyValueMerger implementation * @param utils + * @param addOnsManager */ - public ChartGenerator(HelmClient helmClient, KeyValueMerger merger, Utils utils) { + public ChartGenerator(HelmClient helmClient, KeyValueMerger merger, Utils utils, AddOnsManager addOnsManager) { this.helmClient = helmClient; this.merger = merger; this.utils = utils; + this.addOnsManager = addOnsManager; } /** @@ -60,10 +65,12 @@ public class ChartGenerator { * @param chartBlueprintLocation location of the base helm chart template * @param chartInfo chartInfo object with key-values parsed from the specfile. * @param outputLocation location to store the helm chart + * @param specFileLocation * @return generated helm chart tgz file */ - public File generate(String chartBlueprintLocation, ChartInfo chartInfo, String outputLocation) { + public File generate(String chartBlueprintLocation, ChartInfo chartInfo, String outputLocation, String specFileLocation) { File newChartDir = utils.cloneFileToTempLocation(chartBlueprintLocation + "/base"); + addOnsManager.includeAddons(specFileLocation, newChartDir, chartBlueprintLocation); merger.mergeValuesToChart(chartInfo, newChartDir); helmClient.lint(newChartDir); final File chartLocation = helmClient.packageChart(newChartDir, outputLocation);