[go: up one dir, main page]

Add database prefer mode

What does this MR do?

Add database prefer mode

It is a boring alternative to Add support for container registry detabase pre... (!4635)

Change the default Registry database setting to... (!4672) sets the default registry.database.enabled to prefer.

Implement support for Container Registry's prefer mode with top-level checks:

  • With external PostgreSQL + prefer mode, it rejects the settings, asks the user to enable/disable the database explicitly and review the docs
  • With bundled PostgreSQL + prefer mode, it accepts the settings, passes the prefer mode to the sub-Chart

It also addes the followings to the NOTES:

  • When prefer, warns about it, and relevant info of migration to explicit enabled and external db
  • When disabled, notice about it, and recommendation to migrate.

A few changes to the check config:

  • For registry database metrics and loadbalancing, the user must enable the metadata database explicity. It makes sense since those features require extra explicit settings.

Test plan

global:
  ingress:
    configureCertmanager: false
installCertmanager: false
registry:
  database:
    enabled: prefer
postgresql:
  install: false
helm template gitlab . -f registry.yaml  --show-only charts/registry/templates/configmap.yaml | tail -n 8
dabase.enabled postgresql.install Expected Result
prefer true prefer prefer
prefer false reject reject
true true true true
true false true true
false true no database section no database section
false false no database section no database section

Closes: #6172, #6183

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 Lucas Li

Merge request reports

Loading