Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
0469d91bc1da
Commit
946633c6
authored
May 16, 2018
by
Shinya Maeda
Browse files
Rescue Kubeclient::HttpError when generating prometheus_client
parent
f28943c50809
Changes
1
Show whitespace changes
Inline
Side-by-side
app/models/clusters/applications/prometheus.rb
View file @
0469d91b
...
...
@@ -49,6 +49,11 @@ def prometheus_client
# ensures headers containing auth data are appended to original k8s client options
options
=
kube_client
.
rest_client
.
options
.
merge
(
headers:
kube_client
.
headers
)
RestClient
::
Resource
.
new
(
proxy_url
,
options
)
rescue
Kubeclient
::
HttpError
# If users have mistakenly set parameters or removed the depended clusters,
# `proxy_url` could raise an exception because gitlab can not communicate with the cluster.
# Since `PrometheusAdapter#can_query?` is eargely loaded on environement pages in gitlab,
# we need to silence the exceptions
end
private
...
...
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