This is an automated email from the ASF dual-hosted git repository.

chia7712 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yunikorn-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e81c354 [YUNIKORN-2404] ws/v1/history/apps and 
/ws/v1/history/containers should return empty array instead of null (#795)
5e81c354 is described below

commit 5e81c3546c0e02e137b047861cd540f3c52f32b5
Author: Ryan Lo <[email protected]>
AuthorDate: Wed Feb 14 20:02:32 2024 +0800

    [YUNIKORN-2404] ws/v1/history/apps and /ws/v1/history/containers should 
return empty array instead of null (#795)
    
    Closes: #795
    
    Signed-off-by: Chia-Ping Tsai <[email protected]>
---
 pkg/webservice/handlers.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkg/webservice/handlers.go b/pkg/webservice/handlers.go
index cbd62c82..90f11bb8 100644
--- a/pkg/webservice/handlers.go
+++ b/pkg/webservice/handlers.go
@@ -852,7 +852,7 @@ func getPartitionInfoDAO(lists 
map[string]*scheduler.PartitionContext) []*dao.Pa
 }
 
 func getAppHistoryDAO(records []*history.MetricsRecord) 
[]*dao.ApplicationHistoryDAOInfo {
-       var result []*dao.ApplicationHistoryDAOInfo
+       result := make([]*dao.ApplicationHistoryDAOInfo, 0)
 
        for _, record := range records {
                if record == nil {
@@ -883,7 +883,7 @@ func getPartitionNodesDAO(lists 
map[string]*scheduler.PartitionContext) []*dao.N
 }
 
 func getContainerHistoryDAO(records []*history.MetricsRecord) 
[]*dao.ContainerHistoryDAOInfo {
-       var result []*dao.ContainerHistoryDAOInfo
+       result := make([]*dao.ContainerHistoryDAOInfo, 0)
 
        for _, record := range records {
                if record == nil {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to