diff options
author | Shinya Maeda <shinya@gitlab.com> | 2018-05-16 21:35:24 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2018-05-21 14:52:35 +0900 |
commit | c1e89492375b696b25ff63257c3cbe58ce86cc18 (patch) | |
tree | 8f32c56f58c916e47f9f9ed1737456484dca1bde /app/models/clusters | |
parent | ad9e00917fdff0c311f4755e8be764016ddd18e1 (diff) | |
download | gitlab-ce-c1e89492375b696b25ff63257c3cbe58ce86cc18.tar.gz |
Rescue Kubeclient::HttpError when generating prometheus_client
Diffstat (limited to 'app/models/clusters')
-rw-r--r-- | app/models/clusters/applications/prometheus.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/clusters/applications/prometheus.rb b/app/models/clusters/applications/prometheus.rb index 7b25d8c4089..c702c4ee807 100644 --- a/app/models/clusters/applications/prometheus.rb +++ b/app/models/clusters/applications/prometheus.rb @@ -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 |