Description of problem: If we make a mistake when creating a migplan resource via CLI and the "namespaces" list is not defined in the migplan, the MTC UI crashes and it becomes blank. The backend, nevertheless, can handle the issue and create a CriticalCondition for the migplan. Version-Release number of selected component (if applicable): MTC 1.6.0 It has been found in 1.6.0, but it is probably present in previous releases too. How reproducible: Always Steps to Reproduce: 1. Using the CLI create a migplan resource without a ‘namespaces’ list defined [Use the right values for source cluster, destination cluster and migstorage names] apiVersion: migration.openshift.io/v1alpha1 kind: MigPlan metadata: name: mig-plan-name namespace: openshift-migration spec: destMigClusterRef: name: host namespace: openshift-migration migStorageRef: name: automatic namespace: openshift-migration srcMigClusterRef: name: source-cluster namespace: openshift-migration 2. Open the "plans" screen in the MTC UI. Actual results: The MTC UI crashes and cannot show the plans. It becomes blank. In the browser's console we can see this error: TypeError: Cannot read property 'length' of undefined at Object.t.getPlanInfo (app.bundle.js:2) at app.bundle.js:2 at app.bundle.js:2 at Array.sort (<anonymous>) at Object.t.useSortState (app.bundle.js:2) at t.default (app.bundle.js:2) at ci (app.bundle.js:2) at jr (app.bundle.js:2) at bs (app.bundle.js:2) at Ms (app.bundle.js:2) The migplan status shows this CriticalCondition: status: conditions: - category: Critical lastTransitionTime: "2021-08-17T11:07:39Z" message: The `namespaces` list may not be empty. reason: NotFound status: "True" type: NamespaceListEmpty Expected results: The UI should not crash, and it should report all existing migration plans, as well as this misconfigured migration plan as "Not Ready". Additional info:
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.6.0 security & bugfix 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-2021:3694