Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit 2880add

Browse files
committed
expose cluster health check error to condition message
1 parent 9c7c111 commit 2880add

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/controller/kubefedcluster/clusterclient.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package kubefedcluster
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"strings"
2223
"time"
2324

@@ -141,6 +142,8 @@ func (c *ClusterClient) GetClusterStatus() (*fedv1b1.KubeFedClusterStatus, error
141142
body, err := c.kubeClient.DiscoveryClient.RESTClient().Get().AbsPath("/healthz").Do(context.Background()).Raw()
142143
if err != nil {
143144
runtime.HandleError(errors.Wrapf(err, "Failed to do cluster health check for cluster %q", c.clusterName))
145+
msg := fmt.Sprintf("%s: %v", ClusterNotReachableMsg, err)
146+
newClusterOfflineCondition.Message = &msg
144147
clusterStatus.Conditions = append(clusterStatus.Conditions, newClusterOfflineCondition)
145148
metrics.RegisterKubefedClusterTotal(metrics.ClusterOffline, c.clusterName)
146149
} else {

0 commit comments

Comments
 (0)