Skip to content

Commit e10b5c7

Browse files
committed
Fix assignment for GITLAB_KAS_SECRET
User still only required to set `GITLAB_AGENT_KAS_API_LISTEN_AUTHENTICATION_SECRET_FILE` as `GITLAB_KAS_SECRET` finally default to `GITLAB_AGENT_KAS_API_LISTEN_AUTHENTICATION_SECRET_FILE` (over `GITLAB_AGENT_KAS_GITLAB_AUTHENTICATION_SECRET_FILE`)
1 parent 4a53bc8 commit e10b5c7

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,7 @@ Enable/Disable GitLab agent server for Kubernetes (KAS). See details on [officia
13441344

13451345
##### `GITLAB_KAS_SECRET`
13461346

1347-
File that contains the secret key for verifying access for GitLab KAS. Defaults to `${GITLAB_INSTALL_DIR}/.gitlab_kas_secret`
1347+
File that contains the secret key for verifying access for GitLab KAS. This value will be used for `production.gitlab_kas.secret_file` in gitlab.yml. Defaults to `${GITLAB_AGENT_KAS_GITLAB_AUTHENTICATION_SECRET_FILE}`
13481348

13491349
##### `GITLAB_KAS_EXTERNAL`
13501350

assets/runtime/config/gitlabhq/gitlab.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ production: &base
12221222
enabled: {{GITLAB_KAS_ENABLED}}
12231223
# File that contains the secret key for verifying access for gitlab-kas.
12241224
# Default is '.gitlab_kas_secret' relative to Rails.root (i.e. root of the GitLab app).
1225-
secret_file: {{GITLAB_AGENT_KAS_API_LISTEN_AUTHENTICATION_SECRET_FILE}} # /home/git/gitlab/.gitlab_kas_secret
1225+
secret_file: {{GITLAB_KAS_SECRET}} # /home/git/gitlab/.gitlab_kas_secret
12261226

12271227
# The URL to the external KAS API (used by the Kubernetes agents)
12281228
external_url: {{GITLAB_KAS_EXTERNAL}} # wss://kas.example.com

assets/runtime/env-defaults

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,3 +708,5 @@ GITLAB_AGENT_KAS_WEBSOCKET_TOKEN_SECRET_FILE=${GITLAB_AGENT_KAS_WEBSOCKET_TOKEN_
708708
GITLAB_AGENT_KAS_REDIS_PASSWORD_FILE=${GITLAB_AGENT_KAS_REDIS_PASSWORD_FILE:-}
709709
GITLAB_AGENT_KAS_GITLAB_AUTHENTICATION_SECRET_FILE=${GITLAB_AGENT_KAS_GITLAB_AUTHENTICATION_SECRET_FILE:-${GITLAB_AGENT_KAS_API_LISTEN_AUTHENTICATION_SECRET_FILE}}
710710
GITLAB_AGENT_BUILTIN_KAS_ENABLED=${GITLAB_AGENT_BUILTIN_KAS_ENABLED:-false}
711+
712+
GITLAB_KAS_SECRET=${GITLAB_KAS_SECRET:-${GITLAB_AGENT_KAS_GITLAB_AUTHENTICATION_SECRET_FILE}}

assets/runtime/functions

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ gitlab_configure_gitlab_kas() {
396396
GITLAB_KAS_ENABLED \
397397
GITLAB_KAS_EXTERNAL \
398398
GITLAB_KAS_INTERNAL \
399-
GITLAB_AGENT_KAS_API_LISTEN_AUTHENTICATION_SECRET_FILE \
399+
GITLAB_KAS_SECRET \
400400
GITLAB_KAS_PROXY
401401

402402
printf "Configuring gitlab-agent::KAS (enabled: %s)\n" "${GITLAB_AGENT_BUILTIN_KAS_ENABLED}"
@@ -406,6 +406,7 @@ gitlab_configure_gitlab_kas() {
406406
GITLAB_AGENT_KAS_API_LISTEN_AUTHENTICATION_SECRET_FILE \
407407
GITLAB_AGENT_KAS_PRIVATE_API_LISTEN_AUTHENTICATION_SECRET_FILE \
408408
GITLAB_AGENT_KAS_WEBSOCKET_TOKEN_SECRET_FILE \
409+
GITLAB_AGENT_KAS_GITLAB_AUTHENTICATION_SECRET_FILE \
409410
REDIS_HOST \
410411
REDIS_PORT \
411412
GITLAB_AGENT_KAS_REDIS_PASSWORD_FILE

0 commit comments

Comments
 (0)