Bug 2031101 - Exposed route host to image registry” connecting successfully to invalid registry “xyz.com”
Summary: Exposed route host to image registry” connecting successfully to invalid regi...
Keywords:
Status: ASSIGNED
Alias: None
Product: Migration Toolkit for Containers
Classification: Red Hat
Component: Controller
Version: 1.6.3
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 1.6.6
Assignee: John Matthews
QA Contact: Xin jiang
Richard Hoch
URL:
Whiteboard:
Depends On:
Blocks: 2048537
TreeView+ depends on / blocked
 
Reported: 2021-12-10 14:04 UTC by ssingla
Modified: 2022-08-10 05:06 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2048537 (view as bug list)
Environment:
Last Closed:
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Screenshot (79.34 KB, image/png)
2021-12-10 14:04 UTC, ssingla
no flags Details

Description ssingla 2021-12-10 14:04:17 UTC
Created attachment 1845647 [details]
Screenshot

Severity: Low
Priority: Low

Description of problem: 
When I enter "xyz.com" in "Expose route host to image registry" field, It shows connection successful.

Version-Release number of selected component (if applicable):
MTC 1.6.3
SOURCE CLUSTER: AWS 3.11 MTC 1.5.3 
TARGET CLUSTER: AWS 4.9 MTC 1.6.3 (CONTROLLER)

How reproducible:
Always

Steps to reproduce:
1.  Login to the MTC console 

2. Go to the “Clusters” page and edit the non-host cluster using Kebab menu 

3. Enter “xyz.com” to the field “Exposed route host to image registry” and Click on “Update Cluster”

Actual result:

The UI shows connection successful

Expected result:

The connection should fail as it is not a valid route.

Comment 1 Xin jiang 2021-12-10 14:33:30 UTC
Sachin:

When I enter "xyz.com" in "Expose route host to image registry" field, It shows connection successful.
But this is happening only with this string or sometimes with "xyza.com"
For all others invalid values that I tried, TestConnect is failing as expected.

Comment 2 Pranav Gaikwad 2022-02-28 08:08:45 UTC
OpenShift image registries listen on API path "/v2". The MigCluster controller simply issues a GET request at the API path on provided Registry URL. If a response is not an error, it validates the Registry URL. If the response results in an error, it fails the validation. Now the fun part, "https://xyz.com/v2" actually is a valid API path and returns a 200 when a GET request is made. Hence this bug. To solve it, we need a more sophisticated health check mechanism to determine whether provided URL is valid or not.


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