From e7f5e58ef0a9ac872bf44f05c9d732b8fd71f940 Mon Sep 17 00:00:00 2001 From: Netanel Bollag <54136032+NetanelBollag@users.noreply.github.com> Date: Sun, 12 Nov 2023 09:47:39 +0100 Subject: [PATCH] Fix bug: Sending nil when no namespaced pod owners found (#91) --- src/operator/controllers/otterizeclient/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operator/controllers/otterizeclient/client.go b/src/operator/controllers/otterizeclient/client.go index b32a671..8120603 100644 --- a/src/operator/controllers/otterizeclient/client.go +++ b/src/operator/controllers/otterizeclient/client.go @@ -54,7 +54,7 @@ func (c *CloudClient) AcquireServiceUserAndPassword(ctx context.Context, service } func (c *CloudClient) CleanupOrphanK8SPodEntries(ctx context.Context, _ string, existingServicesByNamespace map[string]*goset.Set[string]) error { - var namespacedPodOwners []otterizegraphql.NamespacedPodOwner + namespacedPodOwners := make([]otterizegraphql.NamespacedPodOwner, 0) for namespace, podOwnerNames := range existingServicesByNamespace { for _, podOwner := range podOwnerNames.Items() { namespacedPodOwners = append(namespacedPodOwners, otterizegraphql.NamespacedPodOwner{Namespace: namespace, Name: podOwner})