Bug 1839077

Summary: [MIG-UI] Forbidden executionNamespace names break the edit UI screen and they cannot be fixed
Product: OpenShift Container Platform Reporter: Sergio <sregidor>
Component: Migration ToolingAssignee: Erik Nelson <ernelson>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.4CC: chezhang, ernelson, jmatthew, jmontleo, mberube, rjohnson, rpattath, whu, xjiang
Target Milestone: ---   
Target Release: 4.4.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: 2020-05-28 11:10:47 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:

Description Sergio 2020-05-22 12:49:33 UTC
Description of problem:
When we create a hook and configure a executionNamespace with a forbidden name (with spaces, for instance) the migration plan show a critical condition. We cannot edit the migration plan to fix this error, since this critical condition breaks the edit screen before we can reach the hooks screen.

Version-Release number of selected component (if applicable):
CAM 1.2 stage

How reproducible:
Always

Steps to Reproduce:
1. Create a migration plan
2. In the hook screen click on "Add Hook"
3. Fill in the form, and in the field "Service account namespace" use a value with spaces, for instance at the beginning, like that: '     namespacewithspaces'
4. Click "Add hook" and "Finish"
5. The migration plan will show a critical condition
      message: The executionNamespace specified is invalid, DNS-1123 label regex used
        for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?'.
6. Click on "Edit" in order to edit the migration plan's problem with the executionNamespace value
7. Try to fix the value you entered in step 3

Actual results:
The edit screen will fail before you can reach the "hooks" screen to fix the wrong value.

Expected results:
We should be able to edit the plan and fix the wrong value that we used when we created the plan.

Additional info:

Comment 1 Erik Nelson 2020-05-22 13:44:57 UTC
Think the UI is simply missing a validation that rejects a hook before creation if it has an invalid value. Need to add this.

Comment 2 Erik Nelson 2020-05-22 17:48:16 UTC
https://github.com/konveyor/mig-ui/pull/876

Comment 3 Sergio 2020-05-26 15:01:17 UTC
Verified in 1.2 CAM stage
openshift-migration-ui-rhel8@sha256:7475399a5d660fdc3fb89c94cc3984b347d6e2ad0c4119836cf2957907be700e

The field is validated and no wrong names are allowed. This warning is shown when a wrong name is introduced:

Invalid character: "xxx ". Name must be DNS-1123 label compliant, starting and ending with a lowercase alphanumeric character and containing only lowercase alphanumeric characters, "." or "-".

Comment 6 errata-xmlrpc 2020-05-28 11:10:47 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, 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-2020:2326