From 0d758cfd410f66c8ae60049ee7ead6a910a42f43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johnny=20Bergstr=C3=B6m?= Date: Thu, 15 Feb 2018 14:31:18 +0100 Subject: [PATCH] Mute upgrade --install default namespace warning Initialize empty selection like in the install command to prevent: WARNING: Namespace doesn't match with previous --- cmd/helm/upgrade.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 7a7dfb0f6..7fca5af68 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -154,9 +154,15 @@ func (u *upgradeCmd) run() error { releaseHistory, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1)) if err == nil { + if u.namespace == "" { + u.namespace = defaultNamespace() + } 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) + fmt.Fprintf(u.out, + "WARNING: Namespace %q doesn't match with previous. Release will be deployed to %s\n", + u.namespace, previousReleaseNamespace, + ) } }