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>2022-04-20 13:00:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-20 13:00:54 +0300
commit3cccd102ba543e02725d247893729e5c73b38295 (patch)
treef36a04ec38517f5deaaacb5acc7d949688d1e187 /lib/container_registry/migration.rb
parent205943281328046ef7b4528031b90fbda70c75ac (diff)
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'lib/container_registry/migration.rb')
-rw-r--r--lib/container_registry/migration.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/lib/container_registry/migration.rb b/lib/container_registry/migration.rb
index b03c94e5ebf..005ef880034 100644
--- a/lib/container_registry/migration.rb
+++ b/lib/container_registry/migration.rb
@@ -2,6 +2,17 @@
module ContainerRegistry
module Migration
+ # Some container repositories do not have a plan associated with them, they will be imported with
+ # the free tiers
+ FREE_TIERS = ['free', 'early_adopter', nil].freeze
+ PREMIUM_TIERS = %w[premium bronze silver premium_trial].freeze
+ ULTIMATE_TIERS = %w[ultimate gold ultimate_trial].freeze
+ PLAN_GROUPS = {
+ 'free' => FREE_TIERS,
+ 'premium' => PREMIUM_TIERS,
+ 'ultimate' => ULTIMATE_TIERS
+ }.freeze
+
class << self
delegate :container_registry_import_max_tags_count, to: ::Gitlab::CurrentSettings
delegate :container_registry_import_max_retries, to: ::Gitlab::CurrentSettings
@@ -28,9 +39,9 @@ module ContainerRegistry
def self.enqueue_waiting_time
return 0 if Feature.enabled?(:container_registry_migration_phase2_enqueue_speed_fast)
- return 6.hours if Feature.enabled?(:container_registry_migration_phase2_enqueue_speed_slow)
+ return 165.minutes if Feature.enabled?(:container_registry_migration_phase2_enqueue_speed_slow)
- 1.hour
+ 45.minutes
end
def self.capacity
@@ -46,8 +57,12 @@ module ContainerRegistry
0
end
- def self.target_plan
- Plan.find_by_name(target_plan_name)
+ def self.target_plans
+ PLAN_GROUPS[target_plan_name]
+ end
+
+ def self.all_plans?
+ Feature.enabled?(:container_registry_migration_phase2_all_plans)
end
end
end