Resolve "Container Registry: Allow toggling redirects to storage backends on a per-repository basis"
What does this MR do?
Enables the user to pass redirect exceptions via Helm values.
Related issues
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
Merge Request Title and Description are up to date, accurate, and descriptive -
MR targeting the appropriate branch -
MR has a green pipeline on GitLab.com
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes -
Documentation created/updated -
Tests added -
Integration tests added to GitLab QA -
Equivalent MR/issue for omnibus-gitlab opened
Testing
Here's a values file to use to confirm this is working:
$ cat testing.values.yaml
registry:
image:
repository: registry.gitlab.com/gitlab-org/container-registry
tag: v2.12.0-gitlab-pre
storage:
redirect:
disable: false
exceptions:
- group-a/project-a.*
- group-b/.*
certmanager-issuer:
email: no@no.com
$ helm template -f test.values.yaml gitlab . | grep exceptions: -B2 -A2
redirect:
disable: false
exceptions:
- group-a/project-a.*
- group-b/.*
You can see the exceptions are listed in the configuration.
{"go_version":"go1.14.5","instance_id":"38ccbf48-265e-4601-a6fd-676b8fb4f8cc","level":"info","msg":"redis not configured","service":"registry","time":"2020-11-19T22:24:30Z","version":"v2.9.1-gitlab-503-g253a66ac"}
{"go_version":"go1.14.5","instance_id":"38ccbf48-265e-4601-a6fd-676b8fb4f8cc","level":"info","msg":"Starting upload purge in 59m0s","service":"registry","time":"2020-11-19T22:24:30Z","version":"v2.9.1-gitlab-503-g253a66ac"}
{"exceptions":["group-a/project-a.*","group-b/.*"],"go_version":"go1.14.5","instance_id":"38ccbf48-265e-4601-a6fd-676b8fb4f8cc","level":"warning","msg":"redirect enabled with exceptions, this feature is temporary and will be removed in a future version","service":"registry","time":"2020-11-19T22:24:30Z","version":"v2.9.1-gitlab-503-g253a66ac"}
{"go_version":"go1.14.5","instance_id":"38ccbf48-265e-4601-a6fd-676b8fb4f8cc","level":"info","msg":"using inmemory blob descriptor cache","service":"registry","time":"2020-11-19T22:24:30Z","version":"v2.9.1-gitlab-503-g253a66ac"}
{"go_version":"go1.14.5","instance_id":"38ccbf48-265e-4601-a6fd-676b8fb4f8cc","level":"info","msg":"listening on [::]:5000","service":"registry","time":"2020-11-19T22:24:30Z","version":"v2.9.1-gitlab-503-g253a66ac"}
Closes #2381 (closed)
Edited by Mitchell Nielsen