Skip to content

Commit

Permalink
Refine the cluster available event messages (#496)
Browse files Browse the repository at this point in the history
Signed-off-by: zhujian <[email protected]>
  • Loading branch information
zhujian7 authored Jun 5, 2024
1 parent 0357cb9 commit 3ac9655
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/registration/hub/lease/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ func (c *leaseController) updateClusterStatus(ctx context.Context, cluster *clus
if updated {
newCluster.SetNamespace(newCluster.Name)
c.mcEventRecorder.Eventf(newCluster, nil, corev1.EventTypeWarning, "AvailableUnknown", "AvailableUnknown",
"The managed cluster (%s) cannot connect to the hub cluster.", cluster.Name)
"The %s is successfully imported. However, the connection check from the managed cluster to the hub cluster has failed", cluster.Name)
}

return err
Expand Down
5 changes: 3 additions & 2 deletions pkg/registration/spoke/managedcluster/status_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,12 @@ func (c *managedClusterStatusController) sendAvailableConditionEvent(
switch newCondition.Status {
case metav1.ConditionTrue:
c.hubEventRecorder.Eventf(newCluster, nil, corev1.EventTypeNormal, "Available", "Available",
"The managed cluster (%s) is available now", cluster.Name)
"The %s is successfully imported, and it is managed by the hub cluster. Its apieserver is available",
cluster.Name)

case metav1.ConditionFalse:
c.hubEventRecorder.Eventf(newCluster, nil, corev1.EventTypeWarning, "Unavailable", "Unavailable",
"The Kube API server of managed cluster (%s) is unavailable.", cluster.Name)
" The %s is successfully imported. However, its Kube API server is unavailable", cluster.Name)
}

}

0 comments on commit 3ac9655

Please sign in to comment.