I tried to delete my jobs with a LabelSelector by client-go:
cli.BatchV1().Jobs("default").Delete(context.TODO(), name, metav1.DeleteOptions{})
And the job was deleted successfully, but the pods of it didn't!
If I delete this job by kubectl
, the pod it created would be deleted automatically.
How could I delete jobs with its pods simply by client-go
?