fix(helm): upgrade with dry-run option displays updated NOTES.txt

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
pull/4012/head
Arash Deshmeh 8 years ago
parent 0deb58ffdf
commit 5d4eaf2e70

@ -25,6 +25,7 @@ import (
"k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/helm" "k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/proto/hapi/services"
"k8s.io/helm/pkg/storage/driver" "k8s.io/helm/pkg/storage/driver"
) )
@ -240,7 +241,24 @@ func (u *upgradeCmd) run() error {
if err != nil { if err != nil {
return prettyError(err) return prettyError(err)
} }
// if dry-run is set, update NOTES from the release response returned by tiller,
// as a dry-run upgrade will not change NOTES on tiller side
status = u.statusFromUpgradeResponse(status, resp)
PrintStatus(u.out, status) PrintStatus(u.out, status)
return nil return nil
} }
func (u *upgradeCmd) statusFromUpgradeResponse(status *services.GetReleaseStatusResponse, resp *services.UpdateReleaseResponse) *services.GetReleaseStatusResponse {
if !u.dryRun {
return status
}
if rel := resp.Release; rel != nil {
status.Info.Status.Notes = rel.Info.Status.Notes
}
return status
}

Loading…
Cancel
Save