fix(helm): fix bug when helm update can't find release 1.

If a release's v1 config map was removed, 'helm upgrade' would fail. It
was calling the wrong function to get its history. This has been fixed.

Closes #1829
pull/2082/head
Matt Butcher 8 years ago
parent 77145657c8
commit d0c9bae9e9
No known key found for this signature in database
GPG Key ID: DCD5F5E5EF32C345

@ -79,11 +79,7 @@ func newHistoryCmd(c helm.Interface, w io.Writer) *cobra.Command {
} }
func (cmd *historyCmd) run() error { func (cmd *historyCmd) run() error {
opts := []helm.HistoryOption{ r, err := cmd.helmc.ReleaseHistory(cmd.rls, helm.WithMaxHistory(cmd.max))
helm.WithMaxHistory(cmd.max),
}
r, err := cmd.helmc.ReleaseHistory(cmd.rls, opts...)
if err != nil { if err != nil {
return prettyError(err) return prettyError(err)
} }

@ -134,7 +134,7 @@ func (u *upgradeCmd) run() error {
// The returned error is a grpc.rpcError that wraps the message from the original error. // The returned error is a grpc.rpcError that wraps the message from the original error.
// So we're stuck doing string matching against the wrapped error, which is nested somewhere // So we're stuck doing string matching against the wrapped error, which is nested somewhere
// inside of the grpc.rpcError message. // inside of the grpc.rpcError message.
_, err := u.client.ReleaseContent(u.release, helm.ContentReleaseVersion(1)) _, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1))
if err != nil && strings.Contains(err.Error(), driver.ErrReleaseNotFound.Error()) { if err != nil && strings.Contains(err.Error(), driver.ErrReleaseNotFound.Error()) {
fmt.Fprintf(u.out, "Release %q does not exist. Installing it now.\n", u.release) fmt.Fprintf(u.out, "Release %q does not exist. Installing it now.\n", u.release)
ic := &installCmd{ ic := &installCmd{

Loading…
Cancel
Save