Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions controlplane/kubeadm/internal/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ type healthCheck func(context.Context) (healthCheckResult, error)
// healthCheck will run a generic health check function and report any errors discovered.
// It does some additional validation to make sure there is a 1;1 match between nodes and machines.
func (m *ManagementCluster) healthCheck(ctx context.Context, check healthCheck, clusterKey types.NamespacedName, controlPlaneName string) error {
var errorList []error
nodeChecks, err := check(ctx)
if err != nil {
return err
errorList = append(errorList, err)
}
errorList := []error{}
for nodeName, err := range nodeChecks {
if err != nil {
errorList = append(errorList, fmt.Errorf("node %q: %v", nodeName, err))
Expand Down Expand Up @@ -388,6 +388,10 @@ func (c *cluster) etcdIsHealthy(ctx context.Context) (healthCheckResult, error)
}
}

if len(response) > 0 {
return response, errors.New("could not check etcd member health")
}

// Check that there is exactly one etcd member for every control plane machine.
// There should be no etcd members added "out of band.""
if len(controlPlaneNodes.Items) != len(knownMemberIDSet) {
Expand Down