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
60a48ef7
Commit
60a48ef7
authored
Aug 12, 2019
by
Gabriel Mazetto
Committed by
Michael Kozono
Aug 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose sync_object_storage in the Geo Node API
parent
91f7b726
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
0 deletions
+11
-0
ee/app/models/geo_node.rb
ee/app/models/geo_node.rb
+1
-0
ee/lib/api/geo_nodes.rb
ee/lib/api/geo_nodes.rb
+1
-0
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+1
-0
ee/spec/models/geo_node_spec.rb
ee/spec/models/geo_node_spec.rb
+8
-0
No files found.
ee/app/models/geo_node.rb
View file @
60a48ef7
...
...
@@ -22,6 +22,7 @@ class GeoNode < ApplicationRecord
validates
:primary
,
uniqueness:
{
message:
'node already exists'
},
if: :primary
validates
:enabled
,
if: :primary
,
acceptance:
{
message:
'Geo primary node cannot be disabled'
}
validates
:sync_object_storage
,
if: :primary
,
inclusion:
{
in:
[
false
],
message:
'Geo primary node doesnt use sync_object_storage value'
}
validates
:access_key
,
presence:
true
validates
:encrypted_secret_access_key
,
presence:
true
...
...
ee/lib/api/geo_nodes.rb
View file @
60a48ef7
...
...
@@ -147,6 +147,7 @@ module API
optional
:repos_max_capacity
,
type:
Integer
,
desc:
'Control the maximum concurrency of repository backfill for this secondary node'
optional
:verification_max_capacity
,
type:
Integer
,
desc:
'Control the maximum concurrency of repository verification for this node'
optional
:container_repositories_max_capacity
,
type:
Integer
,
desc:
'Control the maximum concurrency of container repository sync for this node'
optional
:sync_object_storage
,
type:
Boolean
,
desc:
'Flag indicating if the secondary Geo node will handle replication for blobs on the Object Storage'
end
put
do
not_found!
(
'GeoNode'
)
unless
geo_node
...
...
ee/lib/ee/api/entities.rb
View file @
60a48ef7
...
...
@@ -485,6 +485,7 @@ module EE
expose
:repos_max_capacity
expose
:verification_max_capacity
expose
:container_repositories_max_capacity
expose
:sync_object_storage
,
if:
->
(
geo_node
,
_
)
{
geo_node
.
secondary?
}
# Retained for backwards compatibility. Remove in API v5
expose
:clone_protocol
do
|
_record
,
_options
|
...
...
ee/spec/models/geo_node_spec.rb
View file @
60a48ef7
...
...
@@ -43,6 +43,13 @@ describe GeoNode, :geo, type: :model do
expect
(
primary_node
).
not_to
be_valid
expect
(
primary_node
.
errors
).
to
include
(
:enabled
)
end
it
'requires sync_object_storage to be disabled'
do
primary_node
.
sync_object_storage
=
true
expect
(
primary_node
).
not_to
be_valid
expect
(
primary_node
.
errors
).
to
include
(
:sync_object_storage
)
end
end
context
'when validating url'
do
...
...
@@ -118,6 +125,7 @@ describe GeoNode, :geo, type: :model do
:repos_max_capacity
|
25
:files_max_capacity
|
10
:container_repositories_max_capacity
|
10
:sync_object_storage
|
false
end
with_them
do
...
...
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