Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4a736853
Commit
4a736853
authored
Dec 13, 2017
by
Toon Claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show clear message when set-geo-primary-node was successful
Closes gitlab-org/gitlab-ee#2177.
parent
409d5851
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
2 deletions
+30
-2
changelogs/unreleased-ee/tc-geo-set_primary_node-success.yml
changelogs/unreleased-ee/tc-geo-set_primary_node-success.yml
+5
-0
ee/lib/gitlab/geo/geo_tasks.rb
ee/lib/gitlab/geo/geo_tasks.rb
+6
-2
spec/ee/spec/lib/gitlab/geo/geo_tasks_spec.rb
spec/ee/spec/lib/gitlab/geo/geo_tasks_spec.rb
+19
-0
No files found.
changelogs/unreleased-ee/tc-geo-set_primary_node-success.yml
0 → 100644
View file @
4a736853
---
title
:
Show clear message when set-geo-primary-node was successful
merge_request
:
3768
author
:
type
:
changed
ee/lib/gitlab/geo/geo_tasks.rb
View file @
4a736853
...
...
@@ -5,10 +5,14 @@ module Gitlab
def
set_primary_geo_node
node
=
GeoNode
.
new
(
primary:
true
,
url:
GeoNode
.
current_node_url
)
$stdout
.
puts
"Saving primary Geo
Node with URL
#{
node
.
url
}
"
.
color
(
:green
)
$stdout
.
puts
"Saving primary Geo
node with URL
#{
node
.
url
}
..."
node
.
save
$stdout
.
puts
"Error saving GeoNode:
\n
#{
node
.
errors
.
full_messages
.
join
(
"
\n
"
)
}
"
.
color
(
:red
)
unless
node
.
persisted?
if
node
.
persisted?
$stdout
.
puts
"
#{
node
.
url
}
is now the primary Geo node"
.
color
(
:green
)
else
$stdout
.
puts
"Error saving Geo node:
\n
#{
node
.
errors
.
full_messages
.
join
(
"
\n
"
)
}
"
.
color
(
:red
)
end
end
def
refresh_foreign_tables!
...
...
spec/ee/spec/lib/gitlab/geo/geo_tasks_spec.rb
0 → 100644
View file @
4a736853
require
'spec_helper'
describe
Gitlab
::
Geo
::
GeoTasks
do
describe
'.set_primary_geo_node'
do
before
do
allow
(
GeoNode
).
to
receive
(
:current_node_url
).
and_return
(
'https://primary.geo.example.com'
)
end
it
'sets the primary node'
do
expect
{
subject
.
set_primary_geo_node
}.
to
output
(
/https:\/\/primary.geo.example.com\/ is now the primary Geo node/
).
to_stdout
end
it
'returns error when there is already a Primary node'
do
create
(
:geo_node
,
:primary
)
expect
{
subject
.
set_primary_geo_node
}.
to
output
(
/Error saving Geo node:/
).
to_stdout
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment