mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
Merge pull request #3052 from Lookyan/master
Add previous namespace mismatch warning
This commit is contained in:
commit
f6bff5da94
1 changed files with 9 additions and 1 deletions
|
|
@ -151,7 +151,15 @@ func (u *upgradeCmd) run() 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
|
||||
// inside of the grpc.rpcError message.
|
||||
_, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1))
|
||||
releaseHistory, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1))
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil && strings.Contains(err.Error(), driver.ErrReleaseNotFound(u.release).Error()) {
|
||||
fmt.Fprintf(u.out, "Release %q does not exist. Installing it now.\n", u.release)
|
||||
ic := &installCmd{
|
||||
|
|
|
|||
Loading…
Reference in a new issue