Skip to content
Snippets Groups Projects
Commit daf8957d authored by Robert Marshall's avatar Robert Marshall
Browse files

Merge branch 'registry-pdm' into 'master'

Do not require stopping the registry to apply up DB migrations

See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/8202



Merged-by: default avatarRobert Marshall <rmarshall@gitlab.com>
Approved-by: default avatarJaime Martinez <jmartinez@gitlab.com>
Approved-by: default avatarGabriel Mazetto <gabriel@gitlab.com>
Approved-by: default avatarRobert Marshall <rmarshall@gitlab.com>
Co-authored-by: default avatarJoão Pereira <jpereira@gitlab.com>
parents 3c80abcb fcd524b5
No related branches found
No related tags found
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