Skip to content

Commit

Permalink
Merge branch 'release/2.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pvorb committed Jan 18, 2021
2 parents 59f8724 + cd1e98c commit 492c04b
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 31 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
= Changelog

== Unreleased

== Version 2.9.0

* Support configuring the default URL of the helm repository for helm 2.x via `stableRepoUrl`

== Version 2.8.1

* Fix detection of aarch64/arm64 architecture
Expand All @@ -20,7 +26,7 @@
== Version 2.6.0

* If the package can't resolve a property an exception is no longer thrown. This behaviour is now logged with a
warning and the packaging mojo continues.
warning, and the packaging mojo continues.

== Version 2.5.1

Expand Down
73 changes: 48 additions & 25 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Add the following to your `pom.xml`
<plugin>
<groupId>com.deviceinsight.helm</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>2.8.1</version>
<version>2.9.0</version>
<configuration>
<chartName>my-chart</chartName>
<chartRepoUrl>https://kubernetes-charts.storage.googleapis.com/</chartRepoUrl>
<chartRepoUrl>https://charts.helm.sh/stable</chartRepoUrl>
<helmVersion>3.4.2</helmVersion>
<strictLint>true</strictLint>
<valuesFile>src/test/helm/my-chart/values.yaml</valuesFile>
Expand Down Expand Up @@ -91,9 +91,10 @@ that the correct docker image is used. An example snippet:
|skipSnapshots |`true` |If true, SNAPSHOT versions will be built, but not deployed.
|helmGroupId |`"com.deviceinsight.helm"` |The helm binary `groupId`
|helmArtifactId |`"helm"` |The helm binary `artifactId`
|helmVersion |None |The helm binary `version`
|helmVersion |None |The helm binary `version`. (Make sure to use a recent helm binary version that doesn't use the old Helm Chart repositories from `+https://kubernetes-charts.storage.googleapis.com+`, >= 3.4.0 _or_ >= 2.17.0 if you are still using Helm 2)
|helmDownloadUrl |`"https://get.helm.sh/"` |The URL where the helm binary is downloaded from.
|helm.skip |`false` |If true, execution will be skipped entirely
|stableRepoUrl | `"https://charts.helm.sh/stable"` | For helm 2.x: Can be used to overwrite the default URL for stable repository during `helm init`
|strictLint |`false` |If true, linting fails on warnings (see: <<goal-lint>>)
|valuesFile | None | values file that should be used for goals <<goal-lint>>, <<goal-template>>
|outputFile | target/test-classes/helm.yaml | output file for <<goal-template,template goal>>
Expand Down Expand Up @@ -140,32 +141,54 @@ To use the `deployAtEnd` functionality it's mandatory to put the Helm Maven Plug
<plugins>
...
<plugin>
<groupId>com.deviceinsight.helm</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<chartName>my-chart</chartName>
<chartRepoUrl>https://kubernetes-charts.storage.googleapis.com/</chartRepoUrl>
<helmVersion>2.13.0</helmVersion>
<strictLint>true</strictLint>
<valuesFile>src/test/helm/my-chart/values.yaml</valuesFile>
<deployAtEnd>true</deployAtEnd>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
<goal>lint</goal>
<goal>template</goal>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<groupId>com.deviceinsight.helm</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>2.9.0</version>
<configuration>
<chartName>my-chart</chartName>
<chartRepoUrl>https://charts.helm.sh/stable</chartRepoUrl>
<helmVersion>3.4.2</helmVersion>
<strictLint>true</strictLint>
<valuesFile>src/test/helm/my-chart/values.yaml</valuesFile>
<deployAtEnd>true</deployAtEnd>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
<goal>lint</goal>
<goal>template</goal>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
....

== Troubleshooting

. {blank}
Problem:: The following error message is a common source of trouble, lately:
+
----
[ERROR] Output: Error: error initializing: Looks like "https://kubernetes-charts.storage.googleapis.com" is not a valid chart repository or cannot be reached: Failed to fetch https://kubernetes-charts.storage.googleapis.com/index.yaml : 403 Forbidden
...
[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.9.0:package (default) on project my-project: Error creating helm chart: When executing '/home/user/.m2/repository/com/deviceinsight/helm/helm/2.16.2/helm-2.16.2-linux-amd64.binary init --client-only' got result code '1' -> [Help 1]
----
Solution:: This is likely due to an old version of helm itself. Make sure to configure `<helmVersion>` to a version >= 3.4.0 or, if you are still using Helm 2, a version >= 2.17.0 (https://github.com/helm/charts#%EF%B8%8F-deprecation-and-archive-notice[background information]).
. {blank}
+
Problem:: The following error message appears if you use an old version of helm-maven-plugin:
+
----
[ERROR] Output: Error: error initializing: Looks like "https://kubernetes-charts-incubator.storage.googleapis.com" is not a valid chart repository or cannot be reached: Failed to fetch https://kubernetes-charts-incubator.storage.googleapis.com/index.yaml : 403 Forbidden
----
Solution:: This can be solved by upgrading helm-maven-plugin itself to version 2.7.0 or later (https://github.com/deviceinsight/helm-maven-plugin/issues/67[#67]).

== Releasing

Creating a new release involves the following steps:
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.deviceinsight.helm</groupId>
<artifactId>helm-maven-plugin</artifactId>
<version>2.8.1</version>
<version>2.9.0</version>
<packaging>maven-plugin</packaging>

<name>Helm Maven Plugin</name>
Expand All @@ -20,9 +20,9 @@

<maven.version>3.6.0</maven.version>
<maven-project.version>2.2.1</maven-project.version>
<maven-artifact-transfer.version>0.12.0</maven-artifact-transfer.version>
<maven-artifact-transfer.version>0.13.1</maven-artifact-transfer.version>

<jackson.version>2.12.0</jackson.version>
<jackson.version>2.12.1</jackson.version>
<httpclient.version>4.5.13</httpclient.version>

<junit.jupiter.version>5.7.0</junit.jupiter.version>
Expand All @@ -31,7 +31,7 @@
<dokka-maven-plugin.version>1.4.20</dokka-maven-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<gitflow-maven-plugin.version>1.15.0</gitflow-maven-plugin.version>
<gitflow-maven-plugin.version>1.15.1</gitflow-maven-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
</properties>
Expand Down
5 changes: 4 additions & 1 deletion src/main/kotlin/com/deviceinsight/helm/PackageMojo.kt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class PackageMojo : AbstractHelmMojo() {
@Parameter(property = "incubatorRepoUrl", defaultValue = "https://charts.helm.sh/incubator")
private var incubatorRepoUrl: String = "https://charts.helm.sh/incubator"

@Parameter(property = "stableRepoUrl", defaultValue = "https://charts.helm.sh/stable")
private var stableRepoUrl: String = "https://charts.helm.sh/stable"

@Parameter(property = "addIncubatorRepo", defaultValue = "true")
private var addIncubatorRepo: Boolean = true

Expand Down Expand Up @@ -80,7 +83,7 @@ class PackageMojo : AbstractHelmMojo() {
processHelmConfigFiles(targetHelmDir)

if (majorHelmVersion() < 3) {
executeCmd("$helm init --client-only")
executeCmd("$helm init --client-only --stable-repo-url $stableRepoUrl")
}

if (addIncubatorRepo) {
Expand Down

0 comments on commit 492c04b

Please sign in to comment.