Correct GitLab KAS default redis port configuration
What does this MR do?
Using gitlab-kas with an external redis instance (gitlab_rails['redis_host']
set to e.g. my-redis
) but default port configuration (gitlab_rails['redis_port']
not set) leads to an invalid redis hostname/port combination (e.g. my-redis:
instead of my-redis:6379
). This configuration works perfectly fine for other
GitLab services (e.g. workhorse, gitlab-rails) and is also covered by unit-tests
(see spec/libraries/redis_helper_spec.rb#59
). Those services rely on the
redis_url
method which properly omits the default redis port completely,
whereas gitlab-kas derives the hostname/port combination from the two values
directly but not taking a default port value into account. This MR changes
that behavior by adding a fall-back default redis port, in case no custom one is
set and the tcp connection method is used.
Related issues
None.
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion
Required
-
Merge Request Title, and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com -
Pipeline is green on dev.gitlab.org if the change is touching anything besides documentation or internal cookbooks -> how to check via Community contribution? -
trigger-package
has a green pipeline running against latest commit -> how to check via Community contribution?
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes - [-] Documentation created/updated -> no documentation needed, internal bug-fix
-
Tests added -> New test added - [-] Integration tests added to GitLab QA -> KAS setup not being tested within
gitlab-org/gitlab-qa
- [-] Equivalent MR/issue for the GitLab Chart opened -> Bug/setup doesn't exist in GitLab Chart