From bdc85a934a0be15a717f48d8c0361fd22e5cc210 Mon Sep 17 00:00:00 2001 From: Justin Brooks Date: Wed, 30 Oct 2024 01:52:54 -0400 Subject: [PATCH] add better null checks --- apps/event-worker/src/target-scan/gke.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/event-worker/src/target-scan/gke.ts b/apps/event-worker/src/target-scan/gke.ts index 9975fe9c..78a70c72 100644 --- a/apps/event-worker/src/target-scan/gke.ts +++ b/apps/event-worker/src/target-scan/gke.ts @@ -159,7 +159,15 @@ const getVClustersForCluster = async ( Status: string; Created: string; Version: string; - }>; + }> | null; + + if (vclusters == null) { + log.info( + `No vclusters found for cluster: ${cluster.name}/${cluster.id}`, + { project, clusterName: cluster.name, workspaceId }, + ); + return []; + } const clusterTarget = clusterToTarget( workspaceId,