mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
fix(rollback): errors.Is instead of string comp
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
(cherry picked from commit d158708fbf)
This commit is contained in:
parent
af7c15303a
commit
e2021f8818
1 changed files with 3 additions and 2 deletions
|
|
@ -18,8 +18,8 @@ package action
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
|
|
@ -28,6 +28,7 @@ import (
|
|||
"helm.sh/helm/v4/pkg/kube"
|
||||
"helm.sh/helm/v4/pkg/release/common"
|
||||
release "helm.sh/helm/v4/pkg/release/v1"
|
||||
"helm.sh/helm/v4/pkg/storage/driver"
|
||||
)
|
||||
|
||||
// Rollback is the action for rolling back to a given release.
|
||||
|
|
@ -278,7 +279,7 @@ func (r *Rollback) performRollback(currentRelease, targetRelease *release.Releas
|
|||
}
|
||||
|
||||
deployed, err := r.cfg.Releases.DeployedAll(currentRelease.Name)
|
||||
if err != nil && !strings.Contains(err.Error(), "has no deployed releases") {
|
||||
if err != nil && !errors.Is(err, driver.ErrNoDeployedReleases) {
|
||||
return nil, err
|
||||
}
|
||||
// Supersede all previous deployments, see issue #2941.
|
||||
|
|
|
|||
Loading…
Reference in a new issue