Incorrect git_ssh_url for webhooks on Kubernetes installations
Summary
On Kubernetes installations with a custom GitLab shell port. The value for git_ssh_url in webhooks does not include the custom port. This does not happen on omnibus installations.
This was reported a large premium customer in this ticket
Steps to reproduce
- Create a GitLab install on Kubernetes with a custom GitLab shell port e.g. 7999
- Configure webhooks for push events or merge request events on the project
- The created webhook has an incorrect
git_ssh_urlandssh_urli.e.git@<gitlab_host_name>:<project_path>.gitinstead ofssh://git@<gitlab_host_name>:7999<project_path>.git - Running
Gitlab.config.gitlab_shell.ssh_path_prefixin the rails console for Kubernetes installs will also givegit@<gitlab_host_name>:instead ofssh://git@<gitlab_host_name>:7999
Example Project
What is the current bug behavior?
The webhook does not contain the configured port for git_ssh_url and ssh_url
What is the expected correct behavior?
The webhook should contain the configured port for git_ssh_url and ssh_url
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)(we will only investigate if the tests are passing)
Possible fixes
git_ssh_url is created here: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/repository_url_builder.rb#L19