Description of problem:
When using a custom git servername the "Import from git"-flow tries to validate the git repository and if possible make a build strategy suggestion.
If the URL doesn't contain an indicator if the git provider is one of the supported providers (at the moment GitHub, GitLab, or BitBucket) it shows a dropdown so that the user can select the git provider.
If the user selects this git provider, it ignores the given servername and fetches data from the 'official public API' instead. With this, the user doesn't have the option to use an On-Premises GitLab and BitBucket installation.
Version-Release number of selected component (if applicable):
Verified on 4.8, 4.9 and 4.10 (master branch, tested with fbbf49d71c73ab56d23180de9b4eb6ca3e40a94c)
Don't tested older versions yet
Steps to Reproduce:
1. Switch to developer perspective
2. Navigate to Add > Import from Git
3. Open the browser network inspector
4. Enter a Git URL like https://git.mycompany.com/
5. Switch between the Git providers, if needed change the git URL to trigger a new API call
- When selecting GitHub and BitBucket the network calls always go to api.github.com and api.bitbucket.org (both wrong)
- When selecting GitLab the network inspector shows an API call to git.mycompany.com (correct)
- For each provider the URL should change, but the actual request should always go to the given servername.
Created attachment 1849484 [details]
Created attachment 1849485 [details]
Created attachment 1849486 [details]
Verified on 4.11.0-0.nightly-2022-04-24-135651
Re-tested some of the URLs from https://github.com/openshift/console/pull/10827#issuecomment-1090130677
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 (Important: OpenShift Container Platform 4.11.0 bug fix and security 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.