Container Registry: allow setting database configuration when enabled flag is false
Context
As we work towards Container Registry Self-Managed Rollout::BlocksOff by Default we need to allow users to execute the migration of their registry data into the metadata database.
The migration runs in 3 steps:
- import repositories without tags
- import tags
- import dangling blobs
Users can choose to run a) all 3 steps in one, or b) one step at a time.
For option a) the registry must remain in read-only
mode or be shutdown.
For option b), the registry can operate normally for steps 1 and 3, but must be set to read-only
for step 2.
See gitlab-org/gitlab#436406 (comment 1745537301) for more details.
Problem
The registry chart does not set the database configuration when the flag registry.database.enabled
is set to false
, and
there are a few other checks in the deployment definition that decide whether to mount secrets and other operations based on that flag.
This means that we can't generate a configuration for the registry for the purpose of executing the migration.
Solution
The registry chart should not depend on registry.database.enabled
for setting the configuration. It should simply set the configuration
and pass the value to the registry container as it know how to read the config even if the database is disabled.
Related to gitlab-org/gitlab#436406 (closed)