Skip to content

Commit

Permalink
Added name to DVOObject
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Drobena committed May 10, 2024
1 parent dad8766 commit d7341cd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/dvo_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -289,6 +290,7 @@ func (server *HTTPServer) ProcessSingleDVONamespace(workload types.DVOReport) (
filteredObjects = append(filteredObjects, DVOObject{
Kind: object.Kind,
UID: object.UID,
Name: object.Name,
})
}

Expand Down
2 changes: 2 additions & 0 deletions server/dvo_handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d7341cd

Please sign in to comment.