-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
MTC 1.8.4
-
False
-
-
False
-
ToDo
-
-
Description:
When a MigPlan is executed and fails after the CreateRegistries stage, it leaves behind an internal registry Deployment. If the same MigPlan is executed again by re-running cutover (without a rollback), the controller incorrectly attempts to modify the existing, stale Deployment.
This action fails because the spec.selector field of a Kubernetes Deployment is immutable. This causes the entire migration to fail, blocking the user. The controller should be idempotent and handle the presence of resources from a previous failed attempt.
This behavior is a regression as confirmed by customer, as this workflow (re-running a failed migration without manual cleanup) was successful in MTC v1.7 and did not require manual intervention.
## Steps to Reproduce
- Create and execute a MigPlan by creating a MigMigration object.
- Allow the plan to proceed until the internal migration registry Deployment is created in the openshift-migration namespace.
- Induce a failure in the migration after this step, or manually cancel it. Do not perform a rollback.
- Attempt to re-run the same MigPlan by re-running cutover from UI.
- Observe the status of the new MigMigration.
## Expected Result
The migration controller should recognize that a registry Deployment from a previous attempt already exists. It should gracefully handle this by deleting and recreating the Deployment, allowing the migration to proceed, which was the behavior in MTC v1.7.
## Actual Result
The MigMigration fails immediately with an error in its status conditions, preventing the migration from starting.
The following error is reported in the MigMigration status:
spec: migPlanRef: name: gpes-build namespace: openshift-migration status: conditions: - category: Advisory durable: true message: 'The migration has failed. See: Errors.' reason: CreateRegistries status: "True" type: Failed errors: - 'Deployment.apps "registry-8f555f7e-138e-4900-a64a-b5095b8e3813-678j6" is invalid: spec.selector: Invalid value: v1.LabelSelector{...}: field is immutable'