Add global.appConfig.packageMetadata for OCI sync
What does this MR do?
In GitLab 19.7 and later, GitLab can sync its package metadata from an OCI registry, such as a mirror inside an offline environment. The package_metadata.oci section of gitlab.yml configures it. gitlab-org/gitlab!271771 adds the keys, and gitlab-org/gitlab!271785 adds the connector that reads them, and gitlab-org/gitlab!271788 switches the sync to it. The chart has no values for that section. This MR adds them under global.appConfig.packageMetadata.oci:
| Value | Rendered as | Notes |
|---|---|---|
url |
url |
Turns the source on. Unset renders no package_metadata section. |
username |
username |
Omit for anonymous pulls. |
password.secret, password.key |
password_file |
Operator-supplied secret. The key defaults to password. |
tokenHosts |
token_hosts |
Other hosts that may receive the credentials. An entry is host or host:port, always over HTTPS, and the port defaults to 443. |
The password never enters the ConfigMap. The chart mounts the secret as a file at /etc/gitlab/package-metadata/oci-password in the Webservice, Sidekiq and Toolbox pods and renders that path as password_file, as artifactRegistry does. The chart does not create the secret, because the registry issues the credential.
checkConfig fails the render when username is set without password.secret, and when username, password.secret or tokenHosts is set without url. The values have no effect until a GitLab release includes gitlab-org/gitlab!271788. The Linux package equivalent is gitlab-org/omnibus-gitlab!10121.
Related issues
Related to #6773
How I checked it
helm template test . -f values.yaml \
--set global.appConfig.packageMetadata.oci.url=https://registry.example.com/pmdb \
--set global.appConfig.packageMetadata.oci.username=pmdb-reader \
--set global.appConfig.packageMetadata.oci.password.secret=gitlab-package-metadata-registry \
--set 'global.appConfig.packageMetadata.oci.tokenHosts={auth.example.com}'
bundle exec rspec spec/configuration/package_metadata_spec.rbThe render puts this block in the Webservice, Sidekiq and Toolbox ConfigMaps, and each Deployment projects the secret key password at package-metadata/oci-password. With the values unset, no package_metadata section and no mount render.
package_metadata:
oci:
url: "https://registry.example.com/pmdb"
username: "pmdb-reader"
password_file: /etc/gitlab/package-metadata/oci-password
token_hosts:
- "auth.example.com"spec/configuration/package_metadata_spec.rb covers the unset, url only and full cases for the three ConfigMaps and three Deployments, and both checkConfig failures.
I also ran the branch chart on a k3s cluster (Kubernetes v1.37.2) with GitLab v19.6.2 images and the connector merge requests applied as a patch, against an authenticated registry in the cluster that held real Conan license data. The block rendered in the Webservice and Sidekiq gitlab.yml, and the secret key mounted with the same content in the Webservice, Sidekiq and Toolbox pods. PackageMetadata::LicensesSyncWorker pulled the snapshot and a delta with those credentials and advanced the v3 checkpoint to the newest tag, then advanced it again after one more delta was pushed. With a wrong password the registry answered 401 to Sidekiq and the checkpoint stayed put, and with the values unset nothing rendered. username without password.secret, and the other settings without url, each failed the render. tokenHosts reached the pod settings, but no registry that issues tokens was run, so that path is not covered.
An AI coding assistant wrote this change. The assistant also checked each described behavior against the code in gitlab-org/gitlab!271771 and gitlab-org/gitlab!271788, ran the specs, artifact_registry_spec.rb, helm lint, RuboCop and the helm template command above on a test VM, and ran Vale and markdownlint on the changed documentation pages.
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?
- Yes, on a k3s cluster that synced package metadata from an authenticated registry. The token-issuing registry path was not run.
- Equivalent MR/issue for omnibus-gitlab opened. gitlab-org/omnibus-gitlab!10121
- When ready for review, MR is marked as ready (not a draft) and assigned to a reviewer.
Reviewers checklist
- As soon as you begin reviewing, select Start a review on your first comment so the MR shows Reviewer started review.
- MR has a green pipeline on https://gitlab.com/gitlab-org/charts/gitlab.
- Consider downstream impact to the Operator, as per evaluating impact from changes to GitLab chart.