Bug 2143628

Summary: Unable to create Storage Class Conversion plan due to missing cronjob error in OCP 4.12
Product: Migration Toolkit for Containers Reporter: mohamed <midays>
Component: GeneralAssignee: Pranav Gaikwad <pgaikwad>
Status: CLOSED ERRATA QA Contact: ssingla
Severity: urgent Docs Contact: Anjana Suparna Sriram <asriram>
Priority: unspecified    
Version: 1.7.6CC: rjohnson, tonyg
Target Milestone: ---Keywords: Regression
Target Release: 1.7.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-12-15 02:01:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
error thrown when creating Storage Class Conversion none

Description mohamed 2022-11-17 12:25:40 UTC
Created attachment 1924973 [details]
error thrown when creating Storage Class Conversion

Created attachment 1924973 [details]
error thrown when creating Storage Class Conversion

Description of problem:

Creating new storage class conversion migplan fails due to error thrown on the persistent volumes page. Reconcile failed: [no matches for kind "CronJob" in version "batch/v1beta1"]


Version-Release number of selected component (if applicable):
MTC 1.7.6

How reproducible:
Always

Steps to Reproduce:
1. Navigate to Migation plans page.
2. Click on create new migration plan, and create a new Storage Class Conversion migplan
3. continue creating the plan

Actual results:
In the persistent volumes page an error is thrown that a cronjob is not available in version "batch/v1beta1", and when clicking on cancel, the migplan is created with status "Not ready"


Expected results: 
The Storage Class Conversion plan should be created without any errors


Additional info: 

Controller pod logs

{"level":"info","ts":1668686473.7936459,"logger":"plan","msg":"","migPlan":"scc-migplan","error":"no matches for kind \"CronJob\" in version \"batch/v1beta1\"","stacktrace":"\ngithub.com/konveyor/mig-controller/pkg/controller/migplan.(*ReconcileMigPlan).getClaims()\n\t/remote-source/mig-controller/app/pkg/controller/migplan/pvlist.go:327\ngithub.com/konveyor/mig-controller/pkg/controller/migplan.(*ReconcileMigPlan).updatePvs()\n\t/remote-source/mig-controller/app/pkg/controller/migplan/pvlist.go:115\ngithub.com/konveyor/mig-controller/pkg/controller/migplan.(*ReconcileMigPlan).Reconcile()\n\t/remote-source/mig-controller/app/pkg/controller/migplan/migplan_controller.go:280\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile()\n\t/remote-source/mig-controller/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler()\n\t/remote-source/mig-controller/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem()\n\t/remote-source/mig-controller/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()\n\t/remote-source/mig-controller/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227\nruntime.goexit()\n\t/usr/lib/golang/src/runtime/asm_amd64.s:1581"}
{"level":"info","ts":1668686476.2337732,"logger":"analytics","msg":"CR","migAnalytic":"scc-migplan","conditions":{"conditions":[{"type":"Postponed","status":"True","reason":"TestFailed","category":"Critical","message":"Waiting 10 seconds for referenced MigPlan to become ready.","lastTransitionTime":"2022-11-17T12:00:46Z"}]}}
{"level":"info","ts":1668686476.704837,"logger":"analytics","msg":"Executing df command inside source cluster Restic Pod to measure actual usage for extended PV analysis","migAnalytic":"scc-migplan","pod":"openshift-migration/restic-2vcqr","command":["/bin/bash","-c","df -BMB | grep -E \"(/host_pods/86608f34-232a-406f-bc09-99013806ae97/volumes/.*/pvc-0bc92554-8277-4158-a3e4-0a5a4a2a3756)\""]}
{"level":"info","ts":1668686476.8221862,"logger":"analytics","msg":"Executing du command inside source cluster Restic Pod to measure actual usage for extended PV analysis","migAnalytic":"scc-migplan","pod":"openshift-migration/restic-2vcqr","command":["/bin/bash","-c","du --max-depth=0 --apparent-size --block-size=MB /host_pods/86608f34-232a-406f-bc09-99013806ae97/volumes/*/pvc-0bc92554-8277-4158-a3e4-0a5a4a2a3756"]}

Comment 1 Pranav Gaikwad 2022-11-28 16:18:54 UTC
Fixed in https://github.com/migtools/mig-controller/pull/1328

Comment 5 mohamed 2022-11-29 12:17:42 UTC
Verified using mtc 1.7.6 / prestage

metadata_nvr: openshift-migration-operator-metadata-container-v1.7.6-5

OCP 4.12

Comment 9 errata-xmlrpc 2022-12-15 02:01:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: Migration Toolkit for Containers (MTC) 1.7.6 security and bug fix update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:9047