From 1df41fa72257c611e6d2689022ebb43f8fa50536 Mon Sep 17 00:00:00 2001 From: Robin Bourne Date: Sun, 11 Jun 2023 22:25:40 -0400 Subject: [PATCH 1/3] Add Output on Error --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 6f01a49..bc83e44 100644 --- a/main.go +++ b/main.go @@ -76,6 +76,8 @@ func main() { } if err != nil { fmt.Fprintf(os.Stderr, "error: %v", err) + fmt.Fprint(os.Stderr, "Warning: The following table may be incomplete due to errors detected during the run") + w.Flush() os.Exit(1) } if *exitErr && sockFound { From 8a919fdc220caf9e5b23a5e2e1196d01d99e62c8 Mon Sep 17 00:00:00 2001 From: Robin Bourne Date: Sun, 11 Jun 2023 22:30:22 -0400 Subject: [PATCH 2/3] Add Output on Error --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index bc83e44..c0c3290 100644 --- a/main.go +++ b/main.go @@ -75,8 +75,8 @@ func main() { sockFound, err = runCluster(*requestedNamespace, w, *verbose, *progressBar) } if err != nil { - fmt.Fprintf(os.Stderr, "error: %v", err) - fmt.Fprint(os.Stderr, "Warning: The following table may be incomplete due to errors detected during the run") + fmt.Fprintf(os.Stderr, "error: %v\n", err) + fmt.Fprintln(os.Stderr, "Warning: The following table may be incomplete due to errors detected during the run") w.Flush() os.Exit(1) } From 6e72d0d68346daab25e37a7e373efb5a31e97f26 Mon Sep 17 00:00:00 2001 From: MrFishFinger <4768596+MrFishFinger@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:19:07 +0200 Subject: [PATCH 3/3] fix: ensure that Job owner is actually a CronJob before appending it --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index c0c3290..c9eb208 100644 --- a/main.go +++ b/main.go @@ -273,9 +273,8 @@ func printResources(namespace corev1.Namespace, clientset *kubernetes.Clientset, continue } - // check if the job has an owner - // If it does then it's part of a CronJob - if len(job.ObjectMeta.OwnerReferences) == 0 { + // check if the job has an owner, and that it is of kind `CronJob` + if len(job.ObjectMeta.OwnerReferences) == 0 || job.ObjectMeta.OwnerReferences[0].Kind != "CronJob" { if _, ok := nsJobs[job.Name]; !ok { nsJobs[job.Name] = job }