Skip to content

Redirect Geo git push operations to primary external URL

What does this MR do and why?

Instead of redirecting to the primary Geo internal URL in a git push operation, this now always redirects to the external URL.

This didn't work previously with internal URLs that were not public, or inaccessible to the regular users who may be pushing through a Geo secondary site.

Screenshots or screen recordings

╰─>$ git push -u origin
Username for 'http://p.geo-3k.cat': root
Password for 'http://root@p.geo-3k.cat':
warning: redirecting to http://p.geo-3k.cat/-/push_from_secondary/2/root/proj1.git/
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Writing objects: 100% (3/3), 252 bytes | 252.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote:
remote: This request to a Geo secondary node will be forwarded to the
remote: Geo primary node:
remote:
remote:   http://p.geo-3k.cat/root/proj1.git
remote:
remote:
To http://p.geo-3k.cat/root/proj1.git
   e2c4a90..103fac2  main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.

(before, the redirect was to http://35.*.*.*/.. (primary internal URL set)

How to set up and validate locally

  1. Have a local GDK with Geo set up
  2. On the primary, set a different internal URL (for example, if you use gdk.test with a dummy interface as in the GDK docs, use http://172.16.123.1 or the IP you've used for the dummy interface)
  3. Clone and push to a repo on the secondary GDK, notice the redirect to the internal IP
  4. Checkout this branch, observe that cloning and pushing redirect to the external URL as expected

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports