kokuwaio / helm-maven-plugin

Simple plugin to package helm charts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recursive chart detection (subcharts) future = bug

tipame opened this issue · comments

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Environment (plugin version, maven version, OS, ...):
plugin version: 6.13.0
mvn version: 3.8.1
helm version: 3.8.0

What happened:
I create simple example subchart structure from helm documentation: https://helm.sh/docs/chart_template_guide/subcharts_and_globals/
So i have directory structure:

mychart
    charts
        mysubchart

Plugin configuration:

<configuration>
    <chartDirectory>mychart</chartDirectory>
    <values>
        <yamlFile>etc/my-values.yaml</yamlFile>
    </values>    
</configuration>

I configure all values in my-values.yaml:

testKey: test1

mysubchart:
    testSubKey: test2

I ilso tryed to put values in parent (mychart) values.yaml (with the same result)
in subchart template i have:

...
image: {{ .Values.testSubKey }}
...

I run mvn helm:upgrade@helm-install and get error:

[INFO] --- helm-maven-plugin:6.13.0:upgrade (helm-install) @ mychart ---
[INFO] Upgrading the chart with install C:\test-app\helm\mychart\charts\mysubchart
[ERROR] Error: UPGRADE FAILED: failed to create resource: Deployment.apps "mysubchart" is invalid: spec.template.spec.containers[0].image: Required value

So as you can see from logs - plugin start installing from subchart ("Recursive chart detection (subcharts)" future in action i think) and do not respect helm subchart values hierarchy.

What you expected to happen:
I expect plugin to run install on parent chart and all subcharts will be installed by helm logic.
I do not understand the reason why plagin should implement "Recursive chart detection (subcharts)" future...

How to reproduce it (as minimally and precisely as possible):
Create helm subchart structure and declare values for subcharts in parent chart.

As workaround i managed to set exludes:

<excludes>
    <exclude>**/charts/**</exclude>
    <!-- duplicate pattern with different slashes - cause it not work on different OS -->
    <exclude>**\charts\**</exclude>    
</excludes>

@tipame Can you provide an example project?

Closing due missing feedback