Bug 1967161 - MigAnalytics returns incorrect data after namespace mapping is edited in MigPlan CR
Summary: MigAnalytics returns incorrect data after namespace mapping is edited in MigP...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 1.5.0
Assignee: Pranav Gaikwad
QA Contact: Xin jiang
Avital Pinnick
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-06-02 14:15 UTC by Xin jiang
Modified: 2021-07-28 04:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-07-28 04:08:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-controller pull 1124 0 None closed Bug 1966433: Use helper to retrieve source namespaces in MigAnalytics 2021-06-08 17:33:47 UTC
Red Hat Product Errata RHEA-2021:2929 0 None None None 2021-07-28 04:08:15 UTC

Description Xin jiang 2021-06-02 14:15:33 UTC
Description of problem:
Create a migplan and map the source namespace to a new target namespace name. Check miganalytics and all resources are "0"


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

How reproducible:
Always

Steps to Reproduce:
1. Deploy an application
$ ansible-playbook deploy-app.yml -e use_role=ocp-django -e namespace=testnsmap1
$ oc get pod -n testnsmap1
NAME                             READY     STATUS      RESTARTS   AGE
django-psql-persistent-1-2v762   1/1       Running     0          40m
django-psql-persistent-1-build   0/1       Completed   0          42m
postgresql-1-c5phm               1/1       Running     0          42m

$ oc get pvc -n testnsmap1
NAME         STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
postgresql   Bound     pvc-9320f62c-c3a0-11eb-9084-0e63dfa6a4f1   1Gi        RWO            gp2            43m

2. Create a migplan and edit target namespace with a new name
$ oc -n openshift-migration get migplan  test1 -o yaml
......
  spec:
    destMigClusterRef:
      name: host
      namespace: openshift-migration
    migStorageRef:
      name: automatic
      namespace: openshift-migration
    namespaces:
    - testnsmap1:testnsmap1new


Actual results:
All resources are 0

$ oc -n openshift-migration get miganalytics
NAME          READY   PLAN    PROGRESS   RESOURCES   IMAGES   IMAGESIZE   PVS   PVCAPACITY   AGE
test1         True    test1   100        0           0        0           0     0            20m
test1-6zlsw   True    test1   100        0           0        0           0     0            32m

Expected results:
miganalytics should show correct number


Additional info:

Comment 1 Pranav Gaikwad 2021-06-08 17:35:50 UTC
The root cause of this issue is that the MigPlan spec contains a mapping of namespaces instead of a string which needs to be handled differently for MigAnalytics to work correctly. This is the same root cause for another issue identified with PV resizing: https://bugzilla.redhat.com/show_bug.cgi?id=1966433. Both issues are fixed with this PR: https://github.com/konveyor/mig-controller/pull/1124

Comment 5 Sergio 2021-06-16 10:06:16 UTC
Verified using MTC 1.5.0
SOURCE CLUSTER: AWS OCP 3.11 (CONTROLLER + UI)
TARGET CLUSETR: AWS OCP 4.7

Operator:
    registry.redhat.io/rhmtc/openshift-migration-rhel7-operator@sha256:c0375fa6ecff4d50c181fc3f31d66b6c13023fecb8bcef6899197ccd96c50a30
    - name: MIG_CONTROLLER_REPO
      value: openshift-migration-controller-rhel8@sha256
    - name: MIG_CONTROLLER_TAG
      value: 83f26020b731f78dc9e817186d3247ab46d7daedec62c808be3259ed571656aa
    - name: MIG_UI_REPO
      value: openshift-migration-ui-rhel8@sha256
    - name: MIG_UI_TAG
      value: 4e177e58e311ff2d9c37935308591df5680838255e35b138a696b065c03044f8
    - name: VELERO_REPO
      value: openshift-migration-velero-rhel8@sha256
    - name: VELERO_TAG
      value: e776a798ce8c1b1e6fcc10edaded1e70514a5c6cc2c177dead2d82ef562becde


The miganalytic resource displayed the right data for the created migplan when the namespaces are mapped

$ oc get migplan analytic -o yaml |grep namespaces: -A 2
  namespaces:
  - testnsmap1:testnsmap1-new
  persistentVolumes:

$ oc get miganalytic
NAME             READY     PLAN       PROGRESS   RESOURCES   IMAGES    IMAGESIZE   PVS       PVCAPACITY   AGE
analytic         True      analytic   100        45          1         227Mi       1         1Gi          14s
analytic-xdgkp   True      analytic   100        0           0         0           0         0            14s



We move the status to VERIFIED.

Comment 11 errata-xmlrpc 2021-07-28 04:08:07 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 (Migration Toolkit for Containers (MTC) image release advisory 1.5.0), 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/RHEA-2021:2929


Note You need to log in before you can comment on or make changes to this bug.