Commit cecdaaca authored by Stan Hu's avatar Stan Hu

Merge branch 'sh-rename-geo-rake-task' into 'master'

Rename Rake task from geo:add_primary_node to geo:set_primary_node

See merge request !1579
parents a847bf28 a1500be1
......@@ -74,7 +74,7 @@ namespace :geo do
end
desc 'Make this node the Geo primary'
task :add_primary_node, [:ssh_key_filename] => :environment do |_, args|
task :set_primary_node, [:ssh_key_filename] => :environment do |_, args|
filename = args[:ssh_key_filename]
abort 'GitLab Geo is not supported with this license. Please contact sales@gitlab.com.' unless Gitlab::Geo.license_allows?
abort 'You must specify a filename of an SSH public key' unless filename.present?
......@@ -84,7 +84,7 @@ namespace :geo do
abort "Invalid SSH public key in #{filename}, aborting" unless public_key
add_primary_geo_node(public_key)
set_primary_geo_node(public_key)
end
def load_ssh_public_key(filename)
......@@ -94,7 +94,7 @@ namespace :geo do
nil
end
def add_primary_geo_node(public_key)
def set_primary_geo_node(public_key)
params = { host: Gitlab.config.gitlab.host,
port: Gitlab.config.gitlab.port,
relative_url_root: Gitlab.config.gitlab.relative_url_root,
......
......@@ -5,7 +5,7 @@ describe 'geo rake tasks' do
Rake.application.rake_require 'tasks/geo'
end
describe 'add_primary_node task' do
describe 'set_primary_node task' do
let(:ssh_key) { 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUkxk8m9rVYZ1q4/5xpg3TwTM9QFw3TinPFkyWsiACFKjor3byV6g3vHWTuIS70E7wk2JTXGL0wdrfUG6iQDJuP0BYNxjkluB14nIAfPuXN7V73QY/cqvHogw5o6pPRFD+Szke6FzouNQ70Z/qrM1k7me3e9DMuscMMrMTOR2HLKppNQyP4Jp0WJOyncdWB2NxKXTezy/ZnHv+BdhC0q0JW3huIx9qkBCHio7x8BdyJLMF9KxNYIuCkbP3exs5wgb+qGrjSri6LfAVq8dJ2VYibWxdsUG6iITJF+G4qbcyQjgiMLbxCfNd9bjwmkxSGvFn2EPsAFKzxyAvYFWb/y91 test@host' }
before do
......@@ -21,7 +21,7 @@ describe 'geo rake tasks' do
expect(GeoNode.count).to eq(0)
run_rake_task('geo:add_primary_node', path)
run_rake_task('geo:set_primary_node', path)
expect(GeoNode.count).to eq(1)
node = GeoNode.first
......
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