Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
fix(k8s): correct delete of job when not found
Browse files Browse the repository at this point in the history
  • Loading branch information
stebenz committed Nov 5, 2021
1 parent 5eb4d03 commit c3d718c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/kubernetes/client.go
Expand Up @@ -493,7 +493,7 @@ func (c *Client) DeleteJob(namespace string, name string) error {
return err
}

if job != nil {
if job != nil && err == nil && job.Spec.Selector != nil && job.Spec.Selector.MatchLabels != nil {
//Pod cleanup if necessary
return notFoundIsSuccess(c.DeletePodsByLabels(namespace, job.Spec.Selector.MatchLabels))
}
Expand Down

0 comments on commit c3d718c

Please sign in to comment.