fix SESSION_SERVER_ADDRESS always being included in deployment
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA
What does this MR do?
Fix the helm template to treat the value obtained from the helper isSessionServerAllowed
as a string.
The existing code will always return true
since (include "gitlab-runner.isSessionServerAllowed" .)
always returns the string of "true"
or "false"
.
{{- if (include "gitlab-runner.isSessionServerAllowed" .)}}
...
{{- end }}
This MR checks for string equality to true which will correctly remove the entire environment variable if isSessionServerAllowed
returns "false"
.
Why was this MR needed?
I was attempting to disable the session server and noticed the SESSION_SERVER_ADDRESS
variable was included even though I'd set the include to be false
.
This MR hopes to reduce confusion when users disable the sessionServer
What's the best way to test this MR?
Run the following to observe that the SESSION_SERVER_ADDRESS is correctly set if enabled
% helm template --set sessionServer.enabled=true . | grep -A 1 "name: SESSION_SERVER"
- name: SESSION_SERVER_ADDRESS
value:
Run the following to observe that the SESSION_SERVER_ADDRESS is correctly unset if disabled (and default)
% helm template --set sessionServer.enabled=false . | grep -A 1 "name: SESSION_SERVER"
% helm template . | grep -A 1 "name: SESSION_SERVER"
Before this MR, running with sessionServer.enabled=false
would yeild the same thing as if it were true:
% helm template --set sessionServer.enabled=false . | grep -A 1 "name: SESSION_SERVER"
- name: SESSION_SERVER_ADDRESS
value: