From 23589e657509a48ef33b82cf324197527863dae7 Mon Sep 17 00:00:00 2001 From: Matheus Pimenta Date: Fri, 17 Apr 2026 12:25:25 +0100 Subject: [PATCH] Fix post-renderer conflict of overlapping hooks and templates Signed-off-by: Matheus Pimenta (cherry picked from commit 263affa99b1dc761fc6b384b27a3b61045170cc5) --- go.mod | 7 ++----- go.sum | 4 ++-- internal/action/install.go | 2 ++ internal/action/upgrade.go | 2 ++ 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 677f71655..ba3ea0943 100644 --- a/go.mod +++ b/go.mod @@ -4,11 +4,8 @@ go 1.26.0 replace github.com/fluxcd/helm-controller/api => ./api -// TODO: Remove this after Helm 4.1.4 comes out. -// This fixes the following bugs: -// - https://github.com/helm/helm/issues/31867 -// - https://github.com/helm/helm/issues/31935 -replace helm.sh/helm/v4 => github.com/fluxcd/helm/v4 v4.1.4-flux.1 +// TODO: Remove this after Helm 4.2 comes out. +replace helm.sh/helm/v4 => github.com/fluxcd/helm/v4 v4.1.4-flux.3 // Replace digest lib to master to gather access to BLAKE3. // xref: https://github.com/opencontainers/go-digest/pull/66 diff --git a/go.sum b/go.sum index 0929d272d..f7b8103f4 100644 --- a/go.sum +++ b/go.sum @@ -146,8 +146,8 @@ github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2 github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fluxcd/cli-utils v0.37.2-flux.1 h1:tQ588ghtRN+E+kHq415FddfqA9v4brn/1WWgrP6rQR0= github.com/fluxcd/cli-utils v0.37.2-flux.1/go.mod h1:LcWSu1NYET8d8U7O326RhEm5JkQXCMK6ITu4G1CT02c= -github.com/fluxcd/helm/v4 v4.1.4-flux.1 h1:ntm0bY/1VrqfsJbxlmAVxryGJoFcM5AySHiow/K2268= -github.com/fluxcd/helm/v4 v4.1.4-flux.1/go.mod h1:5dSo8rRgn3OTkDAc/k0Ipw5/Q+BlqKIKZwa0XwSiINI= +github.com/fluxcd/helm/v4 v4.1.4-flux.3 h1:KAKl2gfut/3PVmpRVpD+eIAwh6wx/BklULfRl3VDjf0= +github.com/fluxcd/helm/v4 v4.1.4-flux.3/go.mod h1:5dSo8rRgn3OTkDAc/k0Ipw5/Q+BlqKIKZwa0XwSiINI= github.com/fluxcd/pkg/apis/acl v0.9.0 h1:wBpgsKT+jcyZEcM//OmZr9RiF8klL3ebrDp2u2ThsnA= github.com/fluxcd/pkg/apis/acl v0.9.0/go.mod h1:TttNS+gocsGLwnvmgVi3/Yscwqrjc17+vhgYfqkfrV4= github.com/fluxcd/pkg/apis/event v0.24.1 h1:TClVdn02aiq3sAl9BuzLjjTIxm3JJ83fJ9nchtBa4qg= diff --git a/internal/action/install.go b/internal/action/install.go index 6bfba8f65..f6a9c5e59 100644 --- a/internal/action/install.go +++ b/internal/action/install.go @@ -20,6 +20,7 @@ import ( "context" "fmt" + "helm.sh/helm/v4/pkg/action" helmaction "helm.sh/helm/v4/pkg/action" helmchartutil "helm.sh/helm/v4/pkg/chart/common" helmchart "helm.sh/helm/v4/pkg/chart/v2" @@ -108,6 +109,7 @@ func newInstall(config *helmaction.Configuration, obj *v2.HelmRelease, opts []In } install.PostRenderer = postrender.BuildPostRenderers(obj) + install.PostRenderStrategy = action.PostRenderStrategyNoHooks for _, opt := range opts { opt(install) diff --git a/internal/action/upgrade.go b/internal/action/upgrade.go index 7027ac911..38ed1ca97 100644 --- a/internal/action/upgrade.go +++ b/internal/action/upgrade.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" + "helm.sh/helm/v4/pkg/action" helmaction "helm.sh/helm/v4/pkg/action" helmchartutil "helm.sh/helm/v4/pkg/chart/common" helmchart "helm.sh/helm/v4/pkg/chart/v2" @@ -126,6 +127,7 @@ func newUpgrade(config *helmaction.Configuration, obj *v2.HelmRelease, opts []Up } upgrade.PostRenderer = postrender.BuildPostRenderers(obj) + upgrade.PostRenderStrategy = action.PostRenderStrategyNoHooks for _, opt := range opts { opt(upgrade)