diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 629b3edc0..7a7dfb0f6 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -153,7 +153,7 @@ func (u *upgradeCmd) run() error { // inside of the grpc.rpcError message. releaseHistory, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1)) - if err != nil { + if err == nil { previousReleaseNamespace := releaseHistory.Releases[0].Namespace if previousReleaseNamespace != u.namespace { fmt.Fprintf(u.out, "WARNING: Namespace doesn't match with previous. Release will be deployed to %s\n", previousReleaseNamespace)