1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-28 10:28:36 +00:00

fix: panic in reports controller (#7220)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-05-17 12:45:27 +02:00 committed by GitHub
parent e56c795143
commit 1422fe6b44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -228,7 +228,7 @@ func (c *controller) aggregateReports(ctx context.Context, uid types.UID) (kyver
}
// if we have an aggregated report available, compute results
var errs []error
if aggregated != nil {
if aggregated != nil && len(aggregated.GetOwnerReferences()) != 0 {
owner := aggregated.GetOwnerReferences()[0]
resource := corev1.ObjectReference{
APIVersion: owner.APIVersion,