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
8fa79f3b
Commit
8fa79f3b
authored
Apr 13, 2020
by
Arthur Evstifeev
Committed by
Heinrich Lee Yu
Apr 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle nil results in NetworkPoliciesController#summary
parent
b9997292
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
ee/app/controllers/projects/security/network_policies_controller.rb
...trollers/projects/security/network_policies_controller.rb
+1
-1
ee/changelogs/unreleased/network-stats-fix-nil-results.yml
ee/changelogs/unreleased/network-stats-fix-nil-results.yml
+0
-0
ee/spec/controllers/projects/security/network_policies_controller_spec.rb
...ers/projects/security/network_policies_controller_spec.rb
+9
-0
No files found.
ee/app/controllers/projects/security/network_policies_controller.rb
View file @
8fa79f3b
...
@@ -19,7 +19,7 @@ module Projects
...
@@ -19,7 +19,7 @@ module Projects
interval:
params
[
:interval
]
||
"minute"
,
interval:
params
[
:interval
]
||
"minute"
,
from:
(
Time
.
parse
(
params
[
:from
])
rescue
1
.
hour
.
ago
),
from:
(
Time
.
parse
(
params
[
:from
])
rescue
1
.
hour
.
ago
),
to:
(
Time
.
parse
(
params
[
:to
])
rescue
Time
.
now
)
to:
(
Time
.
parse
(
params
[
:to
])
rescue
Time
.
now
)
)
)
||
{}
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
json
do
format
.
json
do
...
...
ee/changelogs/unreleased/network-stats-fix-nil-results.yml
0 → 100644
View file @
8fa79f3b
ee/spec/controllers/projects/security/network_policies_controller_spec.rb
View file @
8fa79f3b
...
@@ -88,6 +88,15 @@ describe Projects::Security::NetworkPoliciesController do
...
@@ -88,6 +88,15 @@ describe Projects::Security::NetworkPoliciesController do
end
end
end
end
end
end
context
'with nil results'
do
it
'returns network policies summary'
do
allow
(
adapter
).
to
receive
(
:query
).
and_return
(
nil
)
subject
expect
(
response
).
to
have_gitlab_http_status
(
:bad_request
)
end
end
end
end
context
'without prometheus configured'
do
context
'without prometheus configured'
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