Change Geo SSH proxy to internal primary URL
What does this MR do and why?
As Geo SSH proxying traffic happens between gitlab-shell on the secondary site and the primary site, this should go through the internal URL if present.
Not doing so can cause problems with unified URLs, as it can end up in a loop if both external_urls point to the same URL.
Related to #344643 (closed)
Screenshots or screen recordings
Error from #344643 (closed) before:
remote:
remote: This request to a Geo secondary node will be forwarded to the
remote: Geo primary node:
remote:
remote: ssh://git@unified-url.gitlab-geo.test:2222/root/proj22.git
remote:
remote:
remote: ========================================================================
remote:
remote: Failed to contact primary http://unified-url.gitlab-geo.test/root/proj22.git
Error: Failed to open TCP connection to unified-url.gitlab-geo.test:80 (getaddrinfo: Name or service not known)
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.
How to set up and validate locally
On a GDK Geo setup:
- Set an internal URL for the primary, set a non-existing public URL for the same node in the Geo node settings to make it easier to test
- Stop Sidekiq on the secondary
- Create a new project on the primary
- Try to clone/push this new project (should be always proxied to the primary as it doesn't exist on the secondary yet)
- Notice errors reaching the non-existing public URL
- Checkout this branch on the secondary
- Try to clone/push again and it should be working
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Catalin Irimie