"oc create job" fails with "cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on"

Solution Verified - Updated -

Issue

  • When using the oc client with version 4.15 or kubectl version 1.28, manually creating a job from a cronjob as a regular user fails with the following error message:

    $ oc version
    Client Version: 4.15.6
    Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
    Kubernetes Version: v1.28.7+f1b5f6c
    $ oc create job manual-job --from=cronjob/pi
    error: failed to create job: jobs.batch "manual-job" is forbidden: cannot set blockOwnerDeletion if an ownerReference refers to a resource you can't set finalizers on: , <nil>
    

Environment

  • Red Hat OpenShift Container Platform (RHOCP) 4.15

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content