fix (bug): Use the key specified in values to read password

What does this MR do?

fix (bug): Use the key specified in values to read password

We should use the main.password.key here, not main.key. As main.key does not exist, the key defaults to password, even though our documentation asks users to set the key as main_password and create a Kubernetes Secret using the following command:

kubectl create secret generic gitlab-clickhouse-password --from-literal="main_password=PASSWORD_HERE"

Changelog: fixed

I found this bug while working on !4458 (merged). The commit that is selected here was originally included in that MR, and tested with that MR. However, we decided to separate this out into its own MR during the code review process.

This MR also adds a config check to check that the old key global.clickhouse.main.key is not set. For instance, with these additional values added to values.yaml:

global:
  clickhouse:
    enabled: true
    main:
      username: default
      key: main_password
      password:
        secret: gitlab-clickhouse-password
      database: default
      url: https://nlt4h5uv0s.ap-northeast-1.aws.clickhouse.cloud:8443

... the dry-run output of helm install prints the message:

$ helm install --dry-run gitlab-after-bug-fix ./
Error: INSTALLATION FAILED: execution error at (gitlab/templates/NOTES.txt:182:3):
CONFIGURATION CHECKS:

ClickHouse:
  `global.clickhouse.main.key` is set to main_password.
  Please set `global.clickhouse.main.password.key` instead in order to specify the key within the
  gitlab-clickhouse-password Secret that contains the ClickHouse password.

The message goes away once we move the value from global.clickhouse.main.key to global.clickhouse.main.password.key

Author checklist

For general guidance, please follow our Contributing guide.

Required

For anything in this list which will not be completed, please provide a reason in the MR discussion.

  • Merge Request Title and Description are up to date, accurate, and descriptive.
  • MR targeting the appropriate branch.
  • MR has a green pipeline.
  • Documentation created/updated.
  • Tests added/updated, and test plan for scenarios not covered by automated tests.
  • Equivalent MR/issue for omnibus-gitlab opened.

Reviewers checklist

Edited by Siddharth Kannan

Merge request reports

Loading
Loading