Bug 1975372

Summary: Destination namespace in MigPlan custom resource is not validated
Product: Migration Toolkit for Containers Reporter: Sergio <sregidor>
Component: ControllerAssignee: Scott Seago <sseago>
Status: CLOSED ERRATA QA Contact: Xin jiang <xjiang>
Severity: low Docs Contact: Avital Pinnick <apinnick>
Priority: medium    
Version: 1.5.0CC: ernelson, rjohnson
Target Milestone: ---   
Target Release: 1.6.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-09-29 14:35:03 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 2021-06-23 14:14:42 UTC
Description of problem:
When we create a migration plan using the CLI and the we map the source namespace to a destination namespace with a name longer than 63 characters, the migration plan does not show any critical condition. Any migration using a destination namespace with an invalid namespace name will fail, migrations to not-valid namespaces should not be allowed.

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

How reproducible:
Always

Steps to Reproduce:
1. Create a migration plan using the CLI (not the UI) and map the namespace to a destination namespace longer than 63 characters.

Actual results:
No errors or problems reported.

(In DVM an warning is reported regarding the route, though, but even if we take that into account the migration will fail. We need to report a critical condition and forbid the execution of the migration)

Expected results:
The controller should validate that the destination namespace is a valid namespace format. We should probably validate the regexp to make sure that destination namespace is always valid.

Additional info:

Comment 4 Xin jiang 2021-08-30 07:35:51 UTC
Verified by Prasad. 

Image:
 image: registry.redhat.io/rhmtc/openshift-migration-controller-rhel8@sha256:d1bb94853b42abef96ec2c63600ebac41b0163d88fc25571f7b40c6c1d2f8c40

Comment 6 errata-xmlrpc 2021-09-29 14:35:03 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.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