From 927974da11094e822430be96e0d2b5e16aded3ed Mon Sep 17 00:00:00 2001 From: chenliu1993 Date: Wed, 30 Aug 2023 17:28:03 +0900 Subject: [PATCH] Add job type Signed-off-by: chenliu1993 --- pspmutating.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pspmutating.go b/pspmutating.go index 2f88510..363bbe6 100644 --- a/pspmutating.go +++ b/pspmutating.go @@ -73,6 +73,9 @@ func FetchControllerObj(kind, name, namespace string, clientset *kubernetes.Clie return clientset.AppsV1().ReplicaSets(namespace).Get(context.TODO(), name, metav1.GetOptions{}) case "DaemonSet": return clientset.AppsV1().DaemonSets(namespace).Get(context.TODO(), name, metav1.GetOptions{}) + case "Job": + // Both CronJob-managed and Job-managed pods are of type Job owner + return clientset.BatchV1().Jobs(namespace).Get(context.TODO(), name, metav1.GetOptions{}) default: return nil, fmt.Errorf("unsupported controller kind %s", kind) }