deviceinsight / helm-maven-plugin

Maven Plugin for Helm Charts
Apache License 2.0
46 stars 22 forks source link

Make sure `chartRepo` does not exist before executing helm repo add #94

Closed mwalser closed 1 year ago

mwalser commented 3 years ago

When the previous build was interrupted for some reason, a repository named chartRepo can continue to stick around.

This prevents future runs of the helm-maven-plugin by causing the following error:

[ERROR] Output: Error: repository name (chartRepo) already exists, please specify a different name
[…]
[ERROR] Failed to execute goal com.deviceinsight.helm:helm-maven-plugin:2.8.1:package (default) on project project-name: Error creating helm chart: When executing '/home/walsermi/.m2/repository/com/deviceinsight/helm/helm/3.4.2/helm-3.4.2-linux-amd64.binary repo add chartRepo https://repo-url/ --username xxx --password yyy' got result code '1' -> [Help 1]

Ideally the helm-maven-plugin should detect such a situation and perform a clean-up operation.

hho commented 3 years ago

This is really annoying.

Maybe if we make it a more specific name (e.g. helmMavenPluginChartRepo) we could simply always try to remove it before the build?

sflandergan commented 3 years ago

I guess most of the time the repository is identical. We could just skip the helm repo add if the urls match

riccardove commented 2 years ago

I think --force-update can be added to revert to old behavior https://helm.sh/docs/helm/helm_repo_add/