diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-05-21 09:47:43 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-05-22 14:32:41 +0300 |
commit | a0afe659c8cbdeede06e85a7f5d050a847c86f46 (patch) | |
tree | ce9f6fa71e792d2b5794b851dda852933e3c7e23 /app | |
parent | 3ebaa2bdd3948cbe05cb8c4feaae7f39520703b3 (diff) |
Merge branch 'fix-kube_client-proxy_url-exception' into 'master'
Rescue Kubeclient::HttpError when generating prometheus_client
See merge request gitlab-org/gitlab-ce!18989
Diffstat (limited to 'app')
-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 |