kokuwaio / helm-maven-plugin

Simple plugin to package helm charts
MIT License
81 stars 55 forks source link

Repeated force install fails #348

Closed tipame closed 2 months ago

tipame commented 7 months ago

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: 1) Plugin configuration:

<configuration>
    <chartDirectory>helm/</chartDirectory>
    <chartVersion>0.1.0</chartVersion>
    <useLocalHelmBinary>true</useLocalHelmBinary>
    <installForce>true</installForce>
</configuration>

2) helm:install done successfylly, created resource has annotations:

meta.helm.sh/release-name: my-app
meta.helm.sh/release-namespace: my-namespace

3) helm:dry-run fail with error

[ERROR] Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ServiceAccount "my-app" in namespace "my-namespace" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "my-app-1706159052": current value is "my-app"

4) helm:install fail with error:

[ERROR] Error: unknown flag: --force

5) helm:uninstall done successfylly

What you expected to happen: 3) I'm using installForce=true In my configuration and expect repeated instalation (without uninstall) will work fine. So i do not understend why there is inconsistency between install command (creates meta.helm.sh/release-name without uid) and dry-run command (expects meta.helm.sh/release-name with uid). 4) Expect Helm version: 3.8.0 - supports install force flag.

How to reproduce it (as minimally and precisely as possible): Test resource:

apiVersion: v2
name: my-app
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: "1.16.0"
apiVersion: v1
kind: ServiceAccount
metadata:
  name: my-app
  namespace: my-namespace
sschnabe commented 6 months ago

@tipame Name for install was fixed with https://github.com/kokuwaio/helm-maven-plugin/pull/353. --force is not supported by 3.8.0 and was added with 3.11.0. Can you check with updated helm/plugin?

sschnabe commented 2 months ago

Closing due missing feedback