From 3dea9f91dbba8f31daaab55346e58f0fc3a11da5 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 26 Apr 2019 21:16:02 +0800 Subject: [PATCH] add TiDBUpgrading func (#423) --- pkg/apis/pingcap.com/v1alpha1/tidbcluster.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/apis/pingcap.com/v1alpha1/tidbcluster.go b/pkg/apis/pingcap.com/v1alpha1/tidbcluster.go index c336b05806..47c45b0279 100644 --- a/pkg/apis/pingcap.com/v1alpha1/tidbcluster.go +++ b/pkg/apis/pingcap.com/v1alpha1/tidbcluster.go @@ -25,6 +25,10 @@ func (tc *TidbCluster) TiKVUpgrading() bool { return tc.Status.TiKV.Phase == UpgradePhase } +func (tc *TidbCluster) TiDBUpgrading() bool { + return tc.Status.TiDB.Phase == UpgradePhase +} + func (tc *TidbCluster) PDAllPodsStarted() bool { return tc.PDRealReplicas() == tc.Status.PD.StatefulSet.Replicas }