Remove feature flag for Docker container registries replication

Geo fully support replication for Docker container registries, and
the feature flag can be removed.
parent 0fd34d82
......@@ -11,8 +11,6 @@ module Geo
end
def execute
return unless Feature.enabled?(:geo_registry_replication)
log_info('Marking sync as started')
registry.start_sync!
......
......@@ -58,12 +58,11 @@
= form.number_field :verification_max_capacity, class: 'form-control col-sm-2', min: 0
.form-text.text-muted= s_('Geo|Control the maximum concurrency of verification operations for this Geo node')
- if Feature.enabled?(:geo_registry_replication)
.form-row.form-group
.col-sm-8
= form.label :container_repositories_max_capacity, s_('Geo|Container repositories sync capacity'), class: 'font-weight-bold'
= form.number_field :container_repositories_max_capacity, class: 'form-control col-sm-2', min: 0
.form-text.text-muted= s_('Geo|Control the maximum concurrency of container repository operations for this Geo node')
.form-row.form-group
.col-sm-8
= form.label :container_repositories_max_capacity, s_('Geo|Container repositories sync capacity'), class: 'font-weight-bold'
= form.number_field :container_repositories_max_capacity, class: 'form-control col-sm-2', min: 0
.form-text.text-muted= s_('Geo|Control the maximum concurrency of container repository operations for this Geo node')
.form-row.form-group.js-hide-if-geo-secondary{ class: ('hidden' unless geo_node.primary?) }
.col-sm-8
......
......@@ -5,8 +5,6 @@ module Geo
include CronjobQueue
def perform
return unless Feature.enabled?(:geo_registry_replication)
unless Gitlab.config.geo.registry_replication.enabled
log_info('Container Registry replication is not enabled')
return
......
......@@ -15,8 +15,6 @@ module Geo
end
def perform(id)
return unless Feature.enabled?(:geo_registry_replication)
repository = ContainerRepository.find_by_id(id)
if repository.nil?
......
......@@ -9,8 +9,6 @@ module API
resource :container_registry_event do
helpers do
def authenticate_registry_notification!
unauthorized! unless Feature.enabled?(:geo_registry_replication)
endpoint = Gitlab.config.registry.notifications.find { |e| e['name'] == 'geo_event'}
secret_token = endpoint['headers']['Authorization']
......
......@@ -484,7 +484,7 @@ module EE
expose :files_max_capacity
expose :repos_max_capacity
expose :verification_max_capacity
expose :container_repositories_max_capacity, if: ->(_, _) { ::Feature.enabled?(:geo_registry_replication) }
expose :container_repositories_max_capacity
# Retained for backwards compatibility. Remove in API v5
expose :clone_protocol do |_record, _options|
......
......@@ -8,8 +8,6 @@ module Gitlab
include BaseEvent
def process
return unless Feature.enabled?(:geo_registry_replication)
registry.repository_updated!
job_id = ::Geo::ContainerRepositorySyncWorker.perform_async(event.container_repository_id)
......
......@@ -35,18 +35,6 @@ describe API::ContainerRegistryEvent do
expect(response.status).to eq 401
end
it 'returns 401 error status when feature is disabled' do
stub_feature_flags(geo_registry_replication: false)
expect(::ContainerRegistry::EventHandler).not_to receive(:new)
post api('/container_registry_event/events'),
params: { events: events }.to_json,
headers: registry_headers.merge('Authorization' => secret_token)
expect(response.status).to eq 401
end
def stub_registry_endpoints_configuration(configuration)
allow(Gitlab.config.registry).to receive(:notifications) { configuration }
end
......
......@@ -45,16 +45,5 @@ describe Geo::ContainerRepositorySyncService, :geo do
expect(registry.synced?).to be_truthy
end
it 'does not do anything if feature is disabled' do
stub_feature_flags(geo_registry_replication: false)
expect_any_instance_of(Geo::ContainerRepositorySync)
.not_to receive(:execute)
result = described_class.new(container_repository_registry.container_repository).execute
expect(result).to be_nil
end
end
end
......@@ -30,16 +30,6 @@ describe Geo::ContainerRepositorySyncDispatchWorker, :geo, :geo_fdw do
allow(Gitlab::Geo).to receive(:geo_database_configured?).and_call_original
end
it 'does not schedule anything when feature is disabled' do
create(:container_repository)
stub_feature_flags(geo_registry_replication: false)
expect(Geo::ContainerRepositorySyncWorker).not_to receive(:perform_async)
subject.perform
end
it 'does not schedule anything when node is disabled' do
create(:container_repository)
......
......@@ -15,16 +15,6 @@ describe Geo::ContainerRepositorySyncWorker, :geo do
expect(service).to have_received(:execute)
end
it 'does not run ContainerRepositorySyncService if feature disabled' do
stub_feature_flags(geo_registry_replication: false)
container_repository = create(:container_repository)
expect(Geo::ContainerRepositorySyncService).not_to receive(:new).with(container_repository)
described_class.new.perform(container_repository.id)
end
it 'logs error when repository does not exist' do
worker = described_class.new
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment