Description of problem: When creating a job from a cronjob, the ownerReference is wrong as it uses apps/v1 for a cronjob which should be batch/v1beta1 Version-Release number of selected component (if applicable): 4.3.z How reproducible: Always Steps to Reproduce: 1. Install OpenShift 4.3.5 with oc client 4.3.5 2. Create a cronjob (from the documentation): $ echo " apiVersion: batch/v1beta1 kind: CronJob metadata: name: pi spec: schedule: "*/1 * * * *" jobTemplate: spec: template: metadata: labels: parent: "cronjobpi" spec: containers: - name: pi image: perl command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] restartPolicy: OnFailure " | oc create -f - cronjob.batch/pi created 3. Create a job from the previous cronjob: $ oc create job test --from=cronjob/pi error: failed to create job: jobs.batch "test" is forbidden: cannot set blockOwnerDeletion in this case because cannot find RESTMapping for APIVersion apps/v1 Kind CronJob: no matches for kind "CronJob" in version "apps/v1" Actual results: The job cannot be created as it contains a wrong ApiVersion: error: failed to create job: jobs.batch "test" is forbidden: cannot set blockOwnerDeletion in this case because cannot find RESTMapping for APIVersion apps/v1 Kind CronJob: no matches for kind "CronJob" in version "apps/v1" Expected results: The job should be created Additional info: - This works when using oc 4.2 as it doesn't adds the ownerReference - If we use sed to replace apps/v1 with the right version batch/v1beta1 it works: $ oc create job test --from=cronjob/pi --dry-run -o yaml | sed 's/apps\/v1/batch\/v1beta1/' | oc create -f - job.batch/test created
*** This bug has been marked as a duplicate of bug 1814728 ***