Created attachment 1916682 [details] Migration Page Screenshot Created attachment 1916682 [details] Migration Page Screenshot Description of problem: On performing migration of any application from source cluster to destination cluster, migration fails at UnQuiesceDestApplications during Restore. Version-Release number of selected component (if applicable): Source OCP 4.6 Target OCP 4.12 MTC 1.7.5 + OADP 1.0.5 openshift-migration-operator-metadata-container-v1.7.5-21 How reproducible: Always Steps to Reproduce: 1. Deploy basic django application on the source cluster 2. Login to MTC UI and create a migration plan to migrate the application. 3. Run Full Migration - Cutover. Actual results: Migration fails at restore step with below error: "no matches for kind \"CronJob\" in version \"batch/v1beta1\"" openshift-migration migration-controller-6c4dbd474c-nhz8q mtc {"level":"info","ts":1665137137.5673687,"logger":"migration","msg":"Phase execution failed.","migMigration":"migration-0affa","phase":"UnQuiesceDestApplications","phaseDescription":"UnQuiescing (Scaling to N replicas) target cluster Deployments, DeploymentConfigs, StatefulSets, ReplicaSets, DaemonSets, CronJobs and Jobs.","error":"no matches for kind \"CronJob\" in version \"batch/v1beta1\""} openshift-migration migration-controller-6c4dbd474c-nhz8q mtc {"level":"info","ts":1665137137.5674243,"logger":"migration","msg":"","migMigration":"migration-0affa","error":"no matches for kind \"CronJob\" in version \"batch/v1beta1\"","stacktrace":"\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).unQuiesceCronJobs()\n\t/remote-source/mig-controller/app/pkg/controller/migmigration/quiesce.go:620\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).unQuiesceApplications()\n\t/remote-source/mig-controller/app/pkg/controller/migmigration/quiesce.go:88\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).unQuiesceDestApplications()\n\t/remote-source/mig-controller/app/pkg/controller/migmigration/quiesce.go:79\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*Task).Run()\n\t/remote-source/mig-controller/app/pkg/controller/migmigration/task.go:714\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*ReconcileMigMigration).migrate()\n\t/remote-source/mig-controller/app/pkg/controller/migmigration/migrate.go:70\ngithub.com/konveyor/mig-controller/pkg/controller/migmigration.(*ReconcileMigMigration).Reconcile()\n\t/remote-source/mig-controller/app/pkg/controller/migmigration/migmigration_controller.go:264\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:263\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:235\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1.1()\n\t/remote-source/mig-controller/app/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:198\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext.func1()\n\t/remote-source/mig-controller/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1()\n\t/remote-source/mig-controller/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil()\n\t/remote-source/mig-controller/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156\nk8s.io/apimachinery/pkg/util/wait.JitterUntil()\n\t/remote-source/mig-controller/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntilWithContext()\n\t/remote-source/mig-controller/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:185\nk8s.io/apimachinery/pkg/util/wait.UntilWithContext()\n\t/remote-source/mig-controller/app/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:99\nruntime.goexit()\n\t/usr/lib/golang/src/runtime/asm_amd64.s:1581"} Expected results: Migration should be successful Additional info: Not observed yet when target is other than 4.12
Assume related to the k8s 1.25 rebase landing recently: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-25 "The batch/v1beta1 API version of CronJob will no longer be served in v1.25."
Quiesce/unquiesce uses v1beta1 for CronJob (needed for 4.7 and earlier clusters), but this apiversion is no longer available in 4.12 and later. We probably need to check k8s version and use v1 for 1.21/4.8 and newer, and v1beta1 for 1.20/4.8 and older.
https://github.com/migtools/mig-controller/pull/1315 should fix this.
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