Commit 0d758cfd authored by Johnny Bergström's avatar Johnny Bergström

Mute upgrade --install default namespace warning

Initialize empty selection like in the install command to prevent:
WARNING: Namespace doesn't match with previous
parent 289ffcc0
...@@ -154,9 +154,15 @@ func (u *upgradeCmd) run() error { ...@@ -154,9 +154,15 @@ func (u *upgradeCmd) run() error {
releaseHistory, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1)) releaseHistory, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1))
if err == nil { if err == nil {
if u.namespace == "" {
u.namespace = defaultNamespace()
}
previousReleaseNamespace := releaseHistory.Releases[0].Namespace previousReleaseNamespace := releaseHistory.Releases[0].Namespace
if previousReleaseNamespace != u.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,
)
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment