查看 Runner 更新状态功能导致内网 GitLab 实例的 Runner 管理页面加载错误

Summary

  • 问题点:
    • GitLab 15.1 开始增加了一个新功能:在管理区域查看 Runner 的更新状态
    • 该功能默认会连接 https://gitlab.com/api/v4/projects/gitlab-org%2Fgitlab-runner/releases 这个地址获取 Runner 更新状态信息,
    • 对于内网连接不了上述网址的 GitLab 实例会报错:“获取 Runner 数据出错”、 admin runner 页面无法正确加载、导致 runner 无法进行设置;
  • 临时的解决方法:
    • 修改 /etc/hosts 、加入一行记录:127.0.0.1 gitlab.com
  • 建议的修复措施
    • 在 gitlab.rb 中加入配置项、允许关闭此功能;

image

Steps to reproduce

Example Project

What is the current bug behavior?

What is the expected correct behavior?

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