Rescue Kubeclient::HttpError when generating prometheus_client
This commit is contained in:
parent
ad9e00917f
commit
c1e8949237
|
@ -49,6 +49,11 @@ module Clusters
|
|||
# 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
|
||||
|
|
Loading…
Reference in New Issue