From fdda5745bb22a46b25edeef52994137c610a9713 Mon Sep 17 00:00:00 2001 From: Allen Zhong Date: Thu, 19 Nov 2020 12:13:05 +0800 Subject: [PATCH] cluster: ignore no tispark master error when listing and scaling in clusters --- pkg/cluster/manager.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/cluster/manager.go b/pkg/cluster/manager.go index ee66582c0c..e27869d3eb 100644 --- a/pkg/cluster/manager.go +++ b/pkg/cluster/manager.go @@ -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) } @@ -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) } @@ -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)