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

Commit

Permalink
Merge pull request #274 from weaveworks/leave-two-masters
Browse files Browse the repository at this point in the history
Ensure two control-plane nodes remain up while we do an update
  • Loading branch information
bboreham authored Jul 22, 2020
2 parents 7f03c64 + 335f1d9 commit 4f49b82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/wksprovider/controller/wksctl/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,12 +892,12 @@ func (a *MachineController) checkMasterHAConstraint(ctx context.Context) error {
for _, node := range nodes {
if hasConditionTrue(node, corev1.NodeReady) && !hasTaint(node, "NoSchedule") {
avail++
if avail >= 2 {
if avail > 2 { // We need 2 remaining after we take one offline
return nil
}
}
}
return errors.New("Fewer than two master nodes available")
return errors.New("Fewer than two control-plane nodes would be available")
}

func hasConditionTrue(node *corev1.Node, typ corev1.NodeConditionType) bool {
Expand Down

0 comments on commit 4f49b82

Please sign in to comment.