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
76b35f9f
Commit
76b35f9f
authored
Feb 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
2012aa52
a6f882f3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
66 deletions
+10
-66
app/models/clusters/applications/prometheus.rb
app/models/clusters/applications/prometheus.rb
+0
-5
app/services/prometheus/adapter_service.rb
app/services/prometheus/adapter_service.rb
+1
-1
spec/models/clusters/applications/prometheus_spec.rb
spec/models/clusters/applications/prometheus_spec.rb
+0
-59
spec/services/prometheus/adapter_service_spec.rb
spec/services/prometheus/adapter_service_spec.rb
+9
-1
No files found.
app/models/clusters/applications/prometheus.rb
View file @
76b35f9f
...
...
@@ -6,7 +6,6 @@ module Clusters
include
PrometheusAdapter
VERSION
=
'6.7.3'
READY_STATUS
=
[
:installed
,
:updating
,
:updated
,
:update_errored
].
freeze
self
.
table_name
=
'clusters_applications_prometheus'
...
...
@@ -25,10 +24,6 @@ module Clusters
end
end
def
ready?
READY_STATUS
.
include?
(
status_name
)
end
def
chart
'stable/prometheus'
end
...
...
app/services/prometheus/adapter_service.rb
View file @
76b35f9f
...
...
@@ -30,7 +30,7 @@ module Prometheus
return
unless
deployment_platform
.
respond_to?
(
:cluster
)
cluster
=
deployment_platform
.
cluster
return
unless
cluster
.
application_prometheus
&
.
ready
?
return
unless
cluster
.
application_prometheus
&
.
available
?
cluster
.
application_prometheus
end
...
...
spec/models/clusters/applications/prometheus_spec.rb
View file @
76b35f9f
...
...
@@ -27,65 +27,6 @@ describe Clusters::Applications::Prometheus do
end
end
describe
'#ready'
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:cluster
)
{
create
(
:cluster
,
projects:
[
project
])
}
it
'returns true when installed'
do
application
=
build
(
:clusters_applications_prometheus
,
:installed
,
cluster:
cluster
)
expect
(
application
).
to
be_ready
end
it
'returns false when not_installable'
do
application
=
build
(
:clusters_applications_prometheus
,
:not_installable
,
cluster:
cluster
)
expect
(
application
).
not_to
be_ready
end
it
'returns false when installable'
do
application
=
build
(
:clusters_applications_prometheus
,
:installable
,
cluster:
cluster
)
expect
(
application
).
not_to
be_ready
end
it
'returns false when scheduled'
do
application
=
build
(
:clusters_applications_prometheus
,
:scheduled
,
cluster:
cluster
)
expect
(
application
).
not_to
be_ready
end
it
'returns false when installing'
do
application
=
build
(
:clusters_applications_prometheus
,
:installing
,
cluster:
cluster
)
expect
(
application
).
not_to
be_ready
end
it
'returns false when errored'
do
application
=
build
(
:clusters_applications_prometheus
,
:errored
,
cluster:
cluster
)
expect
(
application
).
not_to
be_ready
end
it
'returns true when updating'
do
application
=
build
(
:clusters_applications_prometheus
,
:updating
,
cluster:
cluster
)
expect
(
application
).
to
be_ready
end
it
'returns true when updated'
do
application
=
build
(
:clusters_applications_prometheus
,
:updated
,
cluster:
cluster
)
expect
(
application
).
to
be_ready
end
it
'returns true when errored'
do
application
=
build
(
:clusters_applications_prometheus
,
:update_errored
,
cluster:
cluster
)
expect
(
application
).
to
be_ready
end
end
describe
'#prometheus_client'
do
context
'cluster is nil'
do
it
'returns nil'
do
...
...
spec/services/prometheus/adapter_service_spec.rb
View file @
76b35f9f
...
...
@@ -22,7 +22,15 @@ describe Prometheus::AdapterService do
context
"prometheus service can't execute queries"
do
let
(
:prometheus_service
)
{
double
(
:prometheus_service
,
can_query?:
false
)
}
context
'with cluster with prometheus installed'
do
context
'with cluster with prometheus not available'
do
let!
(
:prometheus
)
{
create
(
:clusters_applications_prometheus
,
:installable
,
cluster:
cluster
)
}
it
'returns nil'
do
expect
(
subject
.
prometheus_adapter
).
to
be_nil
end
end
context
'with cluster with prometheus available'
do
let!
(
:prometheus
)
{
create
(
:clusters_applications_prometheus
,
:installed
,
cluster:
cluster
)
}
it
'returns application handling all environments'
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