Skip to content

Commit 21b1d58

Browse files
refactor: Use existing helper to get cluster session key
Signed-off-by: JiangJiaWei1103 <waynechuang97@gmail.com>
1 parent 0847170 commit 21b1d58

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

historyserver/pkg/historyserver/router.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,12 @@ func (s *ServerHandler) getNode(req *restful.Request, resp *restful.Response) {
459459
return
460460
}
461461

462+
// Get the specified node from the cluster session.
463+
// A cluster lifecycle is identified by a cluster session.
462464
clusterName := req.Attribute(COOKIE_CLUSTER_NAME_KEY).(string)
463465
clusterNamespace := req.Attribute(COOKIE_CLUSTER_NAMESPACE_KEY).(string)
464-
clusterNameID := clusterName + "_" + clusterNamespace
465-
466-
// A cluster lifecycle is identified by a cluster session.
467-
clusterSessionID := clusterNameID + "_" + sessionName
468-
targetNode, found := s.eventHandler.GetNodeByNodeID(clusterSessionID, targetNodeId)
466+
clusterSessionKey := utils.BuildClusterSessionKey(clusterName, clusterNamespace, sessionName)
467+
targetNode, found := s.eventHandler.GetNodeByNodeID(clusterSessionKey, targetNodeId)
469468
if !found {
470469
resp.WriteErrorString(http.StatusNotFound, fmt.Sprintf("node %s not found", targetNodeId))
471470
return

0 commit comments

Comments
 (0)