Uploaded image for project: 'OpenShift Migration Toolkit for Containers'
  1. OpenShift Migration Toolkit for Containers
  2. MIG-1779

Migration Controller Fails with spec.selector: field is immutable Error When Re-running a Failed Plan (Regression from MTC v1.7)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • MTC 1.8.4
    • Migration QE Infra
    • False
    • Hide

      None

      Show
      None
    • 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

      1. Create and execute a MigPlan by creating a MigMigration object.
      1. Allow the plan to proceed until the internal migration registry Deployment is created in the openshift-migration namespace.
      1. Induce a failure in the migration after this step, or manually cancel it. Do not perform a rollback.
      1. Attempt to re-run the same MigPlan by re-running cutover from UI.
      1. 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'

              xjiang@redhat.com Xin Jiang
              rhn-support-chdeshpa Chinmay Deshpande
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: