Skip to content

Commit

Permalink
Merge pull request #2451 from sethp-nr/patch-2
Browse files Browse the repository at this point in the history
🐛 Report all KCP healthcheck errors
  • Loading branch information
k8s-ci-robot committed Feb 26, 2020
2 parents ce51864 + 4cfa74a commit f0bc103
Showing 1 changed file with 6 additions and 2 deletions.
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 @@ -469,6 +469,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

0 comments on commit f0bc103

Please sign in to comment.