From d7341cd7bc1efc3c4c5e7641170255bd159d0b1c Mon Sep 17 00:00:00 2001 From: Jakub Drobena Date: Fri, 10 May 2024 13:48:13 +0200 Subject: [PATCH] Added name to DVOObject --- server/dvo_handlers.go | 2 ++ server/dvo_handlers_test.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/server/dvo_handlers.go b/server/dvo_handlers.go index fce05a130..ab89ba071 100644 --- a/server/dvo_handlers.go +++ b/server/dvo_handlers.go @@ -92,6 +92,7 @@ type DVORecommendation struct { type DVOObject struct { Kind string `json:"kind"` UID string `json:"uid"` + Name string `json:"display_name"` } // readNamespace retrieves namespace UUID from request @@ -289,6 +290,7 @@ func (server *HTTPServer) ProcessSingleDVONamespace(workload types.DVOReport) ( filteredObjects = append(filteredObjects, DVOObject{ Kind: object.Kind, UID: object.UID, + Name: object.Name, }) } diff --git a/server/dvo_handlers_test.go b/server/dvo_handlers_test.go index c3390d8c2..af003da5e 100644 --- a/server/dvo_handlers_test.go +++ b/server/dvo_handlers_test.go @@ -171,10 +171,12 @@ func TestProcessSingleDVONamespace_MustFilterZeroObjects_CCXDEV_12589_Reproducer { UID: "193a2099-0000-1111-916a-d570c9aac158", Kind: "Pod", + Name: "test-name-0001", }, { UID: "193a2099-1234-5678-916a-d570c9aac158", Kind: "DaemonSet", + Name: "test-name-0099", }, } assert.ElementsMatch(t, expectedObjects, processedWorkload.Recommendations[0].Objects)