Skip to content

Commit d877367

Browse files
Merge branch 'aws-containers:main' into pod-scan
2 parents 5dfe199 + 6e839c8 commit d877367

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

main.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ func main() {
7575
sockFound, err = runCluster(*requestedNamespace, w, *verbose, *progressBar)
7676
}
7777
if err != nil {
78-
fmt.Fprintf(os.Stderr, "error: %v", err)
78+
fmt.Fprintf(os.Stderr, "error: %v\n", err)
79+
fmt.Fprintln(os.Stderr, "Warning: The following table may be incomplete due to errors detected during the run")
80+
w.Flush()
7981
os.Exit(1)
8082
}
8183
if *exitErr && sockFound {
@@ -271,9 +273,8 @@ func printResources(namespace corev1.Namespace, clientset *kubernetes.Clientset,
271273
continue
272274
}
273275

274-
// check if the job has an owner
275-
// If it does then it's part of a CronJob
276-
if len(job.ObjectMeta.OwnerReferences) == 0 {
276+
// check if the job has an owner, and that it is of kind `CronJob`
277+
if len(job.ObjectMeta.OwnerReferences) == 0 || job.ObjectMeta.OwnerReferences[0].Kind != "CronJob" {
277278
if _, ok := nsJobs[job.Name]; !ok {
278279
nsJobs[job.Name] = job
279280
}

0 commit comments

Comments
 (0)