From d832b350dd5e582a711b9f4a8e4b0d98ea6863bb Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 10 May 2021 13:57:55 +0200 Subject: [PATCH] Give CRD policy precedence over skipCRDs field This gives the in the previous MINOR release introduced CRD policy precedence, avoiding `skipCRDs is set to false and crds is set to Skip` errors when the `skipCRDs` field is omitted. Signed-off-by: Hidde Beydals --- internal/runner/runner.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/runner/runner.go b/internal/runner/runner.go index 4ed77d160..ccfe1a02f 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -109,7 +109,7 @@ func (r *Runner) Install(hr v2.HelmRelease, chart *chart.Chart, values chartutil install.DisableHooks = hr.Spec.GetInstall().DisableHooks install.DisableOpenAPIValidation = hr.Spec.GetInstall().DisableOpenAPIValidation install.Replace = hr.Spec.GetInstall().Replace - var legacyCRDsPolicy v2.CRDsPolicy = v2.Create + var legacyCRDsPolicy = v2.Create if hr.Spec.GetInstall().SkipCRDs { legacyCRDsPolicy = v2.Skip } @@ -117,10 +117,6 @@ func (r *Runner) Install(hr v2.HelmRelease, chart *chart.Chart, values chartutil if err != nil { return nil, wrapActionErr(r.logBuffer, err) } - if (cRDsPolicy != v2.Skip && legacyCRDsPolicy == v2.Skip) || (cRDsPolicy == v2.Skip && legacyCRDsPolicy != v2.Skip) { - return nil, wrapActionErr(r.logBuffer, - fmt.Errorf("Contradicting CRDs installation settings, skipCRDs is set to %t and crds is set to %s", hr.Spec.GetInstall().SkipCRDs, cRDsPolicy)) - } if cRDsPolicy == v2.Skip || cRDsPolicy == v2.CreateReplace { install.SkipCRDs = true }