Relates to #3134, but does not fix the underlying cause of releases
ended up stuck in SUPERSEDED.
Also cleans up the boolean logic and fixes an ignored error returned
from env.Releases.History().
// Allowe re-use of names if the previous release is marked deleted.
if!reuse{
return"",fmt.Errorf("a release named %s already exists.\nRun: helm ls --all %s; to check the status of the release\nOr run: helm del --purge %s; to delete it",start,start,start)
// Allow re-use of names if the previous release is marked deleted.
// Note that the latest release should never be SUPERSEDED, but this
// can happen on certain failures (issue #3134).
s.Log("name %s exists but is not in use, reusing name",start)
returnstart,nil
}elseifreuse{
default:
return"",errors.New("cannot re-use a name that is still in use")
}
return"",fmt.Errorf("a release named %s already exists.\nRun: helm ls --all %s; to check the status of the release\nOr run: helm del --purge %s; to delete it",start,start,start)