Skip to content

Commit

Permalink
reconciler: use server-side dry-run to generate candidate upgrade man…
Browse files Browse the repository at this point in the history
…ifest

Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
  • Loading branch information
joelanford committed May 30, 2024
1 parent f463c36 commit 7eaef52
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/client/postrenderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ func getTestManifest() string {
testChart := testutil.MustLoadChart("../../pkg/internal/testdata/test-chart-1.2.0.tgz")
i := action.NewInstall(&action.Configuration{})
i.DryRun = true
i.DryRunOption = "client"
i.Replace = true
i.ReleaseName = "release-name"
i.ClientOnly = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,7 @@ func generateRoleRules(dc roleDiscoveryInterface, chart *chart.Chart) ([]rbacv1.
func getDefaultManifests(c *chart.Chart) ([]releaseutil.Manifest, error) {
install := action.NewInstall(&action.Configuration{})
install.DryRun = true
install.DryRunOption = "client"
install.ReleaseName = "release-name"
install.Replace = true
install.ClientOnly = true
Expand Down
1 change: 1 addition & 0 deletions pkg/reconciler/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ func (r *Reconciler) getReleaseState(client helmclient.ActionInterface, obj meta
}
opts = append(opts, func(u *action.Upgrade) error {
u.DryRun = true
u.DryRunOption = "server"
return nil
})
specRelease, err := client.Upgrade(obj.GetName(), obj.GetNamespace(), r.chrt, vals, opts...)
Expand Down

0 comments on commit 7eaef52

Please sign in to comment.