helm-maven-plugin icon indicating copy to clipboard operation
helm-maven-plugin copied to clipboard

Repeated force install fails

Open tipame opened this issue 1 year ago • 1 comments

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>
  1. helm:install done successfylly, created resource has annotations:
meta.helm.sh/release-name: my-app
meta.helm.sh/release-namespace: my-namespace
  1. 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"
  1. helm:install fail with error:
[ERROR] Error: unknown flag: --force
  1. 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

tipame avatar Jan 25 '24 05:01 tipame

@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 avatar Feb 22 '24 15:02 sschnabe