Bug 1967499

Summary: Incorrect error message is displayed in the web console when a namespace mapping is edited
Product: Migration Toolkit for Containers Reporter: whu
Component: UIAssignee: Ian <ibolton>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact: Avital Pinnick <apinnick>
Priority: medium    
Version: 1.5.0CC: ernelson, rjohnson, sregidor, whu, xjiang
Target Milestone: ---   
Target Release: 1.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-07-28 04:08:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
The error screenshot. none

Description whu 2021-06-03 09:13:41 UTC
Created attachment 1788812 [details]
The error screenshot.

Description of problem:
Try to migrate two projects in one migplan in the web console, when going to “”Namespace” phase, change the namespace in the target cluster for both projects. Map the first project from “A” to “A-map”, then map the second project from “B” to “B-map”. But when changing the namespace for the second project, the web console throws out an incorrect error message. 


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

How reproducible:
Always

Prepare two projects in source cluster 
$ ansible-playbook deploy-app.yml -e use_role=ocp-nginxpv -e namespace=ocp-22222-nginx
$ ansible-playbook deploy-app.yml -e use_role=ocp-cakephp -e namespace=ocp-00000-pv-image

Create one migplan to migrate above two projects at the same time in web console
When the page goes to the “Namespace” phase, try to change the namespace of these two projects one by one.  
ocp-00000-pv-image to ocp-00000-pv-image-target 
ocp-22222-nginx to ocp-22222-nginx-target

When changing the  namespace for the second project ocp-22222-nginx, first input “ocp-22222-nginx-a”, then delete last characters back to “ocp-22222-nginx”, will get an error message “A mapped target namespace with that name already exists. Enter a unique name for this target namespace.”

Actual results:
When changing the  namespace for the second project ocp-22222-nginx, first input “ocp-22222-nginx-a”, then delete last characters back to “ocp-22222-nginx”, will get an error message “A mapped target namespace with that name already exists. Enter a unique name for this target namespace.”  In fact “ocp-22222-nginx”  did not exist. 

Check the attachment to get the screen shot.

Expected results:
The web console should not throw out this error message.

Additional info:
In target cluster 
$ oc get ns|grep ocp-22222-nginx  
$            <------- without ocp-22222-nginx

Comment 5 whu 2021-06-24 11:21:51 UTC
Verified against MTC 1.5.0 stage image: 
registry.stage.redhat.io/rhmtc/openshift-migration-rhel7-operator@sha256:17d819f0c28828bc5095bf917563388e05144e2bbbe9c0c86810b350425ee341

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