Skip to content
This repository has been archived by the owner on Mar 28, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1438 from hongchaodeng/cc2
Browse files Browse the repository at this point in the history
*: clear Available condition when doing recovery
  • Loading branch information
hongchaodeng authored Sep 22, 2017
2 parents c7131f5 + bd2e152 commit cbd36ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/apis/etcd/v1beta2/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,12 @@ func (cs *ClusterStatus) SetScalingDownCondition(from, to int) {
cs.setClusterCondition(*c)
}

func (cs *ClusterStatus) AppendRecoveringCondition() {
func (cs *ClusterStatus) SetRecoveringCondition() {
c := newClusterCondition(ClusterConditionRecovering, v1.ConditionTrue,
"Disaster recovery", "Majority is down. Recovering from backup")
cs.setClusterCondition(*c)

cs.ClearCondition(ClusterConditionAvailable)
}

func (cs *ClusterStatus) SetUpgradingCondition(to string) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (c *Cluster) removeMember(toRemove *etcdutil.Member) error {
}

func (c *Cluster) disasterRecovery(left etcdutil.MemberSet) error {
c.status.AppendRecoveringCondition()
c.status.SetRecoveringCondition()

if c.cluster.Spec.SelfHosted != nil {
return errors.New("self-hosted cluster cannot be recovered from disaster")
Expand Down

0 comments on commit cbd36ca

Please sign in to comment.