Fix indentation of active_record secret arrays

What does this MR do?

Fix indentation of active_record secret arrays

The shared secrets script didn't indent Rails secrets with multiple active_record_encryption_primary_keys or active_record_encryption_deterministic_keys correctly.

By default those arrays have a single entry, but multiple entries are valid e.g. when performing a secret rotation.

Changelog: fixed

Impacted versions

All chart versions handling active_record_encryption_primary_keys and active_record_encryption_deterministic_keys are impacted but only in chart 10.2+ this causes a hard failure hence I am suggesting to backport this to 10.2 and 10.3.

Closes shared-secrets job incorrectly indents when mul... (#6639 - closed) • Clemens Beck • 19.4

Test plan

  1. Install GitLab chart

  2. Edit the rails secret to have multiple active_record_encryption_primary_keys and active_record_encryption_deterministic_keys

    $ kubectl get secret gl-rails-secret -n gitlab \
      -o jsonpath='{.data.secrets\.yml}' | base64 -d > secrets.yml
    $ vim secrets.yml
    $ kubectl create secret generic gl-rails-secret \
      --from-file=secrets.yml=secrets.yml \
      --dry-run=client -o yaml -n gitlab | kubectl apply -f -
  3. Upgrade GitLab chart

  4. Confirm shared secrets passed

  5. Confirm all keys persisted

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.
  • Have you validated that your change works end-to-end on a real cluster deployment?
    • Describe how you did it in a comment.
  • Equivalent MR/issue for omnibus-gitlab opened.

Reviewers checklist

Edited by Clemens Beck

Merge request reports

Loading
Loading