Skip to content

Commit 2c77136

Browse files
authored
reconciler: use server-side dry-run to generate candidate upgrade manifest (#344)
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
1 parent 7e1a24a commit 2c77136

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

pkg/client/postrenderer_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ func getTestManifest() string {
206206
testChart := testutil.MustLoadChart("../../pkg/internal/testdata/test-chart-1.2.0.tgz")
207207
i := action.NewInstall(&action.Configuration{})
208208
i.DryRun = true
209+
i.DryRunOption = "client"
209210
i.Replace = true
210211
i.ReleaseName = "release-name"
211212
i.ClientOnly = true

pkg/plugins/helm/v1/scaffolds/internal/templates/config/rbac/manager_role.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ func generateRoleRules(dc roleDiscoveryInterface, chart *chart.Chart) ([]rbacv1.
349349
func getDefaultManifests(c *chart.Chart) ([]releaseutil.Manifest, error) {
350350
install := action.NewInstall(&action.Configuration{})
351351
install.DryRun = true
352+
install.DryRunOption = "client"
352353
install.ReleaseName = "release-name"
353354
install.Replace = true
354355
install.ClientOnly = true

pkg/reconciler/reconciler.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ func (r *Reconciler) getReleaseState(client helmclient.ActionInterface, obj meta
758758
}
759759
opts = append(opts, func(u *action.Upgrade) error {
760760
u.DryRun = true
761+
u.DryRunOption = "server"
761762
return nil
762763
})
763764
specRelease, err := client.Upgrade(obj.GetName(), obj.GetNamespace(), r.chrt, vals, opts...)

0 commit comments

Comments
 (0)