Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-14 21:08:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-14 21:08:31 +0300
commit06ac12d53c3f0b7cee2755a1254bf1af05d55044 (patch)
tree95d0be0bd751a22d6135f496c425c44d774fbe54 /app/services/auth
parentb689f371350fbf1b71f266764ee018befc9b91f7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/auth')
-rw-r--r--app/services/auth/container_registry_authentication_service.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/app/services/auth/container_registry_authentication_service.rb b/app/services/auth/container_registry_authentication_service.rb
index 5fde346c4ab..d42dcb2fd00 100644
--- a/app/services/auth/container_registry_authentication_service.rb
+++ b/app/services/auth/container_registry_authentication_service.rb
@@ -115,7 +115,25 @@ module Auth
#
ensure_container_repository!(path, authorized_actions)
- { type: type, name: path.to_s, actions: authorized_actions }
+ {
+ type: type,
+ name: path.to_s,
+ actions: authorized_actions,
+ migration_eligible: migration_eligible(requested_project, authorized_actions)
+ }.compact
+ end
+
+ def migration_eligible(project, actions)
+ return unless actions.include?('push')
+ return unless Feature.enabled?(:container_registry_migration_phase1)
+
+ # The migration process will start by allowing only specific test and gitlab-org projects using the
+ # `container_registry_migration_phase1_allow` FF. We'll then move on to a percentage rollout using this same FF.
+ # To remove the risk of impacting enterprise customers that rely heavily on the registry during the percentage
+ # rollout, we'll add their top-level group/namespace to the `container_registry_migration_phase1_deny` FF. Later,
+ # we'll remove them manually from this deny list, and their new repositories will become eligible.
+ Feature.disabled?(:container_registry_migration_phase1_deny, project.root_ancestor) &&
+ Feature.enabled?(:container_registry_migration_phase1_allow, project)
end
##