Bug 2056962 - [MTC UI] UI shows the wrong migration type info after changing the target namespace
Summary: [MTC UI] UI shows the wrong migration type info after changing the target nam...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: UI
Version: 1.7.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 1.7.2
Assignee: Mike Turley
QA Contact: Prasad Joshi
Richard Hoch
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-22 13:05 UTC by Prasad Joshi
Modified: 2022-07-01 09:53 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-01 09:52:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github konveyor mig-ui pull 1439 0 None open Bug 2056962: For non-SCC intra-cluster migrations, don't allow target namespace to equal source namespace 2022-06-06 16:49:25 UTC
Github konveyor mig-ui pull 1456 0 None open [Backport - 1.7.2] Bug 2056962: For non-SCC intra-cluster migrations, don't allow target namespace to equal source names... 2022-06-16 17:14:37 UTC
Red Hat Product Errata RHSA-2022:5483 0 None None None 2022-07-01 09:53:10 UTC

Description Prasad Joshi 2022-02-22 13:05:06 UTC
Description of problem: While creating an intra-cluster state migration plan, change the target namespace value to the same as source. UI is showing migration type as a state-migration but from backend it’s showing it as storage class conversion.


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


How reproducible: Always


Steps to Reproduce: 
1. Create an empty project in source cluster
$ oc new-project test
2. Login to the MTC UI and Click on "Create migplan" button
3. Enter the plan name
4. Select migration type as a "State migration"
5. Select target and source cluster as a same
6. On the namespace page click on the edit button(Pencil Icon) and change the target namespace value to similar as source.
7. Click on Next and create a migplan


Actual results: Backend is treating this plan as a storageclass conversion but the UI is showing the migration type as a state migration. 


Expected results: UI should not allow us to change/edit the target namespace value which is equal to source namespace. 


Additional info: 
$ oc get migplan test -o yaml
apiVersion: migration.openshift.io/v1alpha1
kind: MigPlan
metadata:
  annotations:
    migration.openshift.io/selected-migplan-type: state
  name: test
  namespace: openshift-migration
spec:
  destMigClusterRef:
    name: source-cluster
    namespace: openshift-migration
  migStorageRef:
    name: automatic
    namespace: openshift-migration
  namespaces:
  - ocp-32834-pvc-terminating:ocp-32834-pvc-terminating
  srcMigClusterRef:
    name: source-cluster
    namespace: openshift-migration
status:
  conditions:
  - category: Advisory
    lastTransitionTime: "2022-02-22T12:36:35Z"
    message: This is an intra-cluster migration plan and none of the source namespaces are mapped to different destination namespaces. This plan can only be used for Storage Conversion.
    reason: StorageConversionPlan
    status: "True"
    type: MigrationTypeIdentified
  - category: Required
    lastTransitionTime: "2022-02-22T12:36:36Z"
    message: The `persistentVolumes` list has been updated with discovered PVs.
    reason: Done
    status: "True"
    type: PvsDiscovered
  - category: Required
    lastTransitionTime: "2022-02-22T12:36:36Z"
    message: The storage resources have been created.
    reason: Done
    status: "True"
    type: StorageEnsured
  - category: Required
    lastTransitionTime: "2022-02-22T12:36:36Z"
    message: The migration plan is ready.
    status: "True"
    type: Ready
  destStorageClasses:
  - accessModes:
    - ReadWriteOnce
    default: true
    name: gp2
    provisioner: kubernetes.io/aws-ebs
  excludedResources:
  - imagetags
  - templateinstances
  - clusterserviceversions
  - packagemanifests
  - subscriptions
  - servicebrokers
  - servicebindings
  - serviceclasses
  - serviceinstances
  - serviceplans
  - operatorgroups
  - events
  - events.events.k8s.io
  - rolebindings.authorization.openshift.io
  observedDigest: e97b7e5e0e9393493fa3ffb090f69dcae0201b10c34382305e5a15f2f3efc1f4
  srcStorageClasses:
  - accessModes:
    - ReadWriteOnce
    default: true
    name: gp2
    provisioner: kubernetes.io/aws-ebs

Comment 5 Prasad Joshi 2022-06-22 08:14:05 UTC
Verified with MTC 1.7.2 (Stage)

UI is not allowing target namespace as source. I see the below warning under the target namespace section when source and target namespace name is same.

"""
Target namespace name cannot be the same as source namespace name. Enter a unique name for this target namespace.
"""

Moving this to verified status.

Comment 11 errata-xmlrpc 2022-07-01 09:52:59 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 (Moderate: Migration Toolkit for Containers (MTC) 1.7.2 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:5483


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