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
ebbd2aeb
Commit
ebbd2aeb
authored
Aug 19, 2019
by
John Cai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle when server info doesn't have the storage in question
parent
fc9ad598
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+2
-1
spec/lib/gitlab/gitaly_client_spec.rb
spec/lib/gitlab/gitaly_client_spec.rb
+10
-0
No files found.
lib/gitlab/gitaly_client.rb
View file @
ebbd2aeb
...
...
@@ -406,7 +406,8 @@ module Gitlab
def
self
.
filesystem_id
(
storage
)
response
=
Gitlab
::
GitalyClient
::
ServerService
.
new
(
storage
).
info
storage_status
=
response
.
storage_statuses
.
find
{
|
status
|
status
.
storage_name
==
storage
}
storage_status
.
filesystem_id
storage_status
&
.
filesystem_id
end
def
self
.
filesystem_id_from_disk
(
storage
)
...
...
spec/lib/gitlab/gitaly_client_spec.rb
View file @
ebbd2aeb
...
...
@@ -27,6 +27,16 @@ describe Gitlab::GitalyClient do
end
end
describe
'.filesystem_id'
do
it
'returns an empty string when the storage is not found in the response'
do
response
=
double
(
"response"
)
allow
(
response
).
to
receive
(
:storage_statuses
).
and_return
([])
allow_any_instance_of
(
Gitlab
::
GitalyClient
::
ServerService
).
to
receive
(
:info
).
and_return
(
response
)
expect
(
described_class
.
filesystem_id
(
'default'
)).
to
eq
(
nil
)
end
end
describe
'.stub_class'
do
it
'returns the gRPC health check stub'
do
expect
(
described_class
.
stub_class
(
:health_check
)).
to
eq
(
::
Grpc
::
Health
::
V1
::
Health
::
Stub
)
...
...
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