From f8b39c97241379e1f47d4ac5a72bbf0082041915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thor=20Anker=20Kvisg=C3=A5rd=20Lange?= Date: Fri, 8 Mar 2024 13:16:55 +0100 Subject: [PATCH] feat: Add apiVersion to scan upload data --- pkg/dependencies/dependencies.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pkg/dependencies/dependencies.go b/pkg/dependencies/dependencies.go index 3e4b0f3..103f700 100644 --- a/pkg/dependencies/dependencies.go +++ b/pkg/dependencies/dependencies.go @@ -37,11 +37,12 @@ type ScanResult struct { } type WorkloadRef struct { - FQDN string `json:"cluster"` - NRN string `json:"nrn"` - Kind string `json:"kind"` - Namespace string `json:"namespace"` - Name string `json:"name"` + FQDN string `json:"cluster"` + NRN string `json:"nrn"` + ApiVersion string `json:"apiVersion"` + Kind string `json:"kind"` + Namespace string `json:"namespace"` + Name string `json:"name"` } type Service interface { @@ -229,8 +230,9 @@ func (c *client) PushScan(ctx context.Context, repo string, res *ScanResult) err func RefFromKind(obj kc.Object) WorkloadRef { return WorkloadRef{ - Kind: obj.GetObjectKind().GroupVersionKind().Kind, - Namespace: obj.GetNamespace(), - Name: obj.GetName(), + Kind: obj.GetObjectKind().GroupVersionKind().Kind, + ApiVersion: obj.GetObjectKind().GroupVersionKind().GroupVersion().Identifier(), + Namespace: obj.GetNamespace(), + Name: obj.GetName(), } }