sourceDir/outputDir for helm and target fabric8:distro are not working
See original GitHub issueDescription
We are trying to generate kubernetes configurations/helm as delivery for multiple environments. In our development environment we use additional configuration which is not necessary in release artefacts. Our approach is to use multiple fabric8 directories with resource fragments, let’s say src/main/fabric8-dev and src/main/fabric8-prod, like mentioned in #729 . Is there an other way to achieve this goal?
For each environment we have configured an execution with own targetDir configuration. Now we are experiencing the problem that we can not set the sourceDir for helm charts as expected.
<configuration>
<resourceDir>${basedir}/src/main/fabric8-dev</resourceDir>
<targetDir>${basedir}/target/classes/META-INF/fabric8-dev</targetDir>
<helm>
<chart>${helm.chart.name}-dev</chart>
<sourceDir>${basedir}/target/classes/META-INF/fabric8-dev</sourceDir>
</helm>
</configuration>
It looks like the sourceDir for helm is always loaded from property fabric8.helm.sourceDir, the helm config is ignored. https://github.com/fabric8io/fabric8-maven-plugin/blob/9102af60e232c1ac6e2cc29d81ffd8f13f562bab/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/HelmMojo.java#L136-L139
As an alternative we have tried to use the target fabric8:distro to create a tarball to use as delivery but this doesn’t work at all. The target always fails with:
goal io.fabric8:fabric8-maven-plugin:3.5.31:distro failed: [local_module_path]/target/distro isn’t a directory.
In this case the helm configuration for outputDir is also ignored as far as i can see in the Mojo. https://github.com/fabric8io/fabric8-maven-plugin/blob/9102af60e232c1ac6e2cc29d81ffd8f13f562bab/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/DistroMojo.java#L157-L160
Info
- f-m-p version : 3.5.31
- Maven version (
mvn -v
) :3.3.3
Issue Analytics
- State:
- Created 6 years ago
- Comments:14
Top GitHub Comments
Hi @elmguyc
Thats does not relate to the issue described, but i experienced the same issue you are describing with the maven plugin update to 3.5.33. Since 3.5.32 with #1077 you can make use of a template to parametrise the helm chart. For the generation of the helm chart there is now the k8s-template expected (even if you don’t make use of a template): https://github.com/fabric8io/fabric8-maven-plugin/blob/426649978709e5654d0a144cc6f4d1c6d054884d/plugin/src/main/java/io/fabric8/maven/plugin/mojo/build/HelmMojo.java#L300-L307
The k8s-template is generated by fabric8:resource if you have placed a template.yaml in your fabric8 resource fragment folder (resourceDir: default “src/main/fabric8/”). Sadly this part is not well documented.
example template.yaml:
you’re welcome.
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!