Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/helm/helm3/helm3.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func (h *Helm3Client) UpgradeRelease(releaseName string, chart string, valuesPat
args := []string{
"upgrade", releaseName, chart,
"--install",
"--skip-crds",
"--history-max", fmt.Sprintf("%d", Options.HistoryMax),
"--timeout", Options.Timeout.String(),
"--post-renderer", "./post-renderer",
Expand Down
8 changes: 5 additions & 3 deletions pkg/helm/helm3lib/helm3lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func (h *LibClient) upgradeRelease(releaseName string, chartName string, valuesP
}

upg.Install = true
upg.SkipCRDs = true
upg.MaxHistory = int(options.HistoryMax)
upg.Timeout = options.Timeout

Expand Down Expand Up @@ -235,6 +236,7 @@ func (h *LibClient) upgradeRelease(releaseName string, chartName string, valuesP
if helmPostRenderer != nil {
instClient.PostRenderer = helmPostRenderer
}
instClient.SkipCRDs = true
instClient.Timeout = options.Timeout
instClient.ReleaseName = releaseName
instClient.UseReleaseName = true
Expand Down Expand Up @@ -434,14 +436,14 @@ func (h *LibClient) Render(releaseName, chartName string, valuesPaths, setValues
slog.String("chart", chartName),
slog.String("namespace", namespace))

inst := newInstAction(namespace, releaseName)
inst := newDryRunInstAction(namespace, releaseName)

rs, err := inst.Run(chart, resultValues)
if err != nil {
// helm render can fail because the CRD were previously created
// handling this case we can reinitialize RESTClient and repeat one more time by backoff
_ = h.actionConfigInit()
inst = newInstAction(namespace, releaseName)
inst = newDryRunInstAction(namespace, releaseName)

rs, err = inst.Run(chart, resultValues)
}
Expand All @@ -462,7 +464,7 @@ func (h *LibClient) Render(releaseName, chartName string, valuesPaths, setValues
return rs.Manifest, nil
}

func newInstAction(namespace, releaseName string) *action.Install {
func newDryRunInstAction(namespace, releaseName string) *action.Install {
inst := action.NewInstall(actionConfig)
inst.DryRun = true

Expand Down
Loading