Skip to content
Snippets Groups Projects
Commit fcd524b5 authored by João Pereira's avatar João Pereira
Browse files

Do not require stopping the registry to apply up DB migrations

Allows the container registry metadata database to be updated
without a restart of the registry service.

Related https://gitlab.com/gitlab-org/container-registry/-/issues/1516

Changelog: changed
parent 6189151e
No related merge requests found
......@@ -196,11 +196,11 @@
end
def self.needs_stop!(options)
case options[:subcommand]
when 'up', 'down'
options[:needs_stop] = true unless options.has_key? :dry_run
else
options[:needs_stop] = false
end
options[:needs_stop] =
if options[:subcommand] == 'down' && !options.key?(:dry_run)
true
else
false
end
end
end
......@@ -44,7 +44,7 @@
shared_examples 'parses dry_run option' do
it 'parses dry-run correctly' do
expected_options = { subcommand: command, dry_run: '-d' }
expected_options = { subcommand: command, dry_run: '-d', needs_stop: false }
expect(Migrate.parse_options!(%W(migrate #{command} -d), {})).to eq(expected_options)
end
......@@ -59,7 +59,7 @@
it_behaves_like 'parses dry_run option'
it 'parses subcommand correctly' do
expected_options = { subcommand: 'up', limit: '5', skip_post_deploy: '-s', needs_stop: true }
expected_options = { subcommand: 'up', limit: '5', skip_post_deploy: '-s', needs_stop: false }
expect(Migrate.parse_options!(%W(migrate #{command} -s -l 5), {})).to eq(expected_options)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment