Commit 86d2405d authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch 'issue_337800' into 'master'

Set total of Progress bar nil when replication is disabled

See merge request gitlab-org/gitlab!68303
parents d8364dd7 64716b33
......@@ -477,12 +477,17 @@ class GeoNodeStatus < ApplicationRecord
end
def load_container_registry_data
return unless container_repositories_replication_enabled
self.container_repositories_count = container_registry_finder.registry_count
self.container_repositories_synced_count = container_registry_finder.synced_count
self.container_repositories_failed_count = container_registry_finder.failed_count
self.container_repositories_registry_count = container_registry_finder.registry_count
if container_repositories_replication_enabled
self.container_repositories_count = container_registry_finder.registry_count
self.container_repositories_synced_count = container_registry_finder.synced_count
self.container_repositories_failed_count = container_registry_finder.failed_count
self.container_repositories_registry_count = container_registry_finder.registry_count
else
self.container_repositories_count = nil
self.container_repositories_synced_count = nil
self.container_repositories_failed_count = nil
self.container_repositories_registry_count = nil
end
end
def load_designs_data
......
......@@ -502,6 +502,18 @@ RSpec.describe GeoNodeStatus, :geo do
expect(subject.container_repositories_count).to be_nil
end
end
context 'when old container repositories counts exist' do
before do
stub_geo_setting(registry_replication: { enabled: false })
end
it 'returns nil' do
described_class.current_node_status.update!(container_repositories_count: 3)
expect(subject.container_repositories_count).to be_nil
end
end
end
describe '#container_repositories_synced_count' do
......
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