-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add appVersion to the generated Chart.yaml file #2472
Comments
Should be fixed by #2390
Can be fixed by adding the |
Thanks for the quick reply @manusa
Cool, is a SNAPSHOT of 1.16.0 available somewhere or do I need to build it locally? Looking at documentation and https://mvnrepository.com/artifact/org.eclipse.jkube/kubernetes-maven-plugin didn't help much.
Is that a comment about the code and pointing at https://github.com/eclipse/jkube/blob/master/jkube-kit/resource/helm/src/main/java/org/eclipse/jkube/kit/resource/helm/HelmConfig.java? Or is there a way to do that today with In doubt, I looked again at https://eclipse.dev/jkube/docs/kubernetes-maven-plugin/#jkube:helm and played around in the <plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>${jkube.version}</version>
<configuration>
<helm>
<parameters>
<parameter>
<name>appVersion</name>
<value>${project.version}</value>
</parameter>
</parameters>
</helm>
</configuration>
</plugin> |
We publish nightly snapshots (1.16-SNAPSHOT), see: https://github.com/eclipse/jkube/blob/master/USING-SNAPSHOT-ARTIFACTS.md
No. However, with the current snapshot, you can take the fragment approach. The rest of my message was about a pointer on how to resolve this particular issue by enhancing the HelmConfig class. But this would need to be implemented. |
Thanks for the pointer. With
appVersion: ${project.version} this yields appVersion: "${project.version}" so the latest plugin allows the Is there a way to make this work? |
I think we had an issue with some of those variables. <properties>
<helm.appVersion>${project.version}</helm.appVersion>
</properties> Then use appVersion: ${helm.appVersion} in your chart. That should definitely work. |
Awesome @manusa , this works! 🎉 So as a summary:
<properties>
<helm.appVersion>${project.version}</helm.appVersion>
</properties>
# Add appVersion through intermediate variable - https://github.com/eclipse/jkube/issues/2472
appVersion: ${helm.appVersion} Thanks a lot |
Since this is an easy fix (adding the appVersion to HelmConfig), I'm going to implement it now so that you can avoid the tedious workaround using fragments. |
@manusa thanks a lot! please note however that if you add ./mvnw clean install -Dmaven.test.skip
./mvnw -pl microservice-app k8s:resource k8s:helm
helm lint microservice-app/target/jkube/helm/microservice-app/kubernetes/microservice-app-0.0.1-SNAPSHOT.tar.gz
Using fragments, I overrode the I think that if you want to add it unconditionnally, you would need to bump |
Nice, good catch. |
I think that in your case it complains about the chart type. I've double checked docs and Also did a helm lint with the following Chart.yaml: apiVersion: v1
name: helm-zero-config
version: 0.0.1-SNAPSHOT
appVersion: 0.0.1-SNAPSHOT and there were no complaints. |
You are absolutely correct, re-reading the helm error message, and everything was there. 🙃 Indeed, I also added to my project type: application ... and got confused when testing. Thanks for the quick change and marking it for the next release! |
Changes have been merged, you should be able to test everything after SNAPSHOTS get released hopefully tonight. Thanks for the feedback, please keep it coming, especially for the Helm features which we want to improve in the near future. |
Thanks, I confirm that it now works with the SNAPSHOT, now that my hacks have been removed. diff --git a/microservice-app/pom.xml b/microservice-app/pom.xml
index 92b1f2a..9c97831 100644
--- a/microservice-app/pom.xml
+++ b/microservice-app/pom.xml
@@ -11,11 +11,6 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>microservice-app</artifactId>
- <properties>
- <!-- TEMP see https://github.com/eclipse/jkube/issues/2472 -->
- <helm.appVersion>${project.version}</helm.appVersion>
- </properties>
-
<dependencies>
<dependency>
<groupId>com.rakuten</groupId>
diff --git a/microservice-app/src/main/jkube/Chart.helm.yml b/microservice-app/src/main/jkube/Chart.helm.yml
index fd8402c..bafd1ad 100644
--- a/microservice-app/src/main/jkube/Chart.helm.yml
+++ b/microservice-app/src/main/jkube/Chart.helm.yml
@@ -1,7 +1,5 @@
-# JKube defaults to v1, move to later version
+# JKube defaults to v1, move to later version for "type" attribute
apiVersion: v2
-# Add appVersion through intermediate variable - https://github.com/eclipse/jkube/issues/2472
-appVersion: ${helm.appVersion}
type: application
# Our own custom icon - makes 'helm lint' happy
icon: https://fr.shopping.rakuten.com/visuels/0_content_square/autres/rakuten-logo6.svg
\ No newline at end of file
Thanks for the kind words, other question / issue coming tonight :) |
Component
Kubernetes Maven Plugin
Is your enhancement related to a problem? Please describe
I would like to get the appVersion added to the chart, so that when I do
When I do a simple:
The generated
Chart.yaml
contains aversion
key, but noappVersion
keyOutput is
Rather than
This was mentioned in the following issue 3 years ago, at the time when helm 2 apparently didn't have
appVersion
#113Describe the solution you'd like
I would like the
appVersion
to be automatically added with the project version (same behaviour asversion
)Describe alternatives you've considered
Another option is to have Chart resource fragments that allow adding a
Chart.helm.yml
insrc/main/jkube
.And if this file contains
then this gets templated and added to the output
Chart.yml
Additional context
No response
The text was updated successfully, but these errors were encountered: