Skip to content

Commit

Permalink
cluster: ignore no tispark master error when listing and scaling in c…
Browse files Browse the repository at this point in the history
…lusters
  • Loading branch information
AstroProfundis committed Nov 19, 2020
1 parent bd9a03a commit fdda574
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/cluster/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ func (m *Manager) ListCluster() error {

for _, name := range names {
metadata, err := m.meta(name)
if err != nil && !errors.Is(perrs.Cause(err), meta.ErrValidate) {
if err != nil && !errors.Is(perrs.Cause(err), meta.ErrValidate) &&
!errors.Is(perrs.Cause(err), spec.ErrNoTiSparkMaster) {
return perrs.Trace(err)
}

Expand Down Expand Up @@ -347,7 +348,9 @@ func (m *Manager) CleanCluster(clusterName string, gOpt operator.Options, cleanO
func (m *Manager) DestroyCluster(clusterName string, gOpt operator.Options, destroyOpt operator.Options, skipConfirm bool) error {
metadata, err := m.meta(clusterName)
if err != nil && !errors.Is(perrs.Cause(err), meta.ErrValidate) &&
!errors.Is(perrs.Cause(err), spec.ErrNoTiSparkMaster) {
!errors.Is(perrs.Cause(err), spec.ErrNoTiSparkMaster) &&
!errors.Is(perrs.Cause(err), spec.ErrMultipleTiSparkMaster) &&
!errors.Is(perrs.Cause(err), spec.ErrMultipleTisparkWorker) {
return perrs.AddStack(err)
}

Expand Down Expand Up @@ -1366,7 +1369,9 @@ func (m *Manager) ScaleIn(
}

metadata, err := m.meta(clusterName)
if err != nil && !errors.Is(perrs.Cause(err), meta.ErrValidate) {
if err != nil && !errors.Is(perrs.Cause(err), meta.ErrValidate) &&
!errors.Is(perrs.Cause(err), spec.ErrMultipleTiSparkMaster) &&
!errors.Is(perrs.Cause(err), spec.ErrMultipleTisparkWorker) {
// ignore conflict check error, node may be deployed by former version
// that lack of some certain conflict checks
return perrs.AddStack(err)
Expand Down

0 comments on commit fdda574

Please sign in to comment.