Commit 98b3c36d authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'fix_prometheus_configured_blocked' into 'master'

Fix job page not loading because kuberenetes/prometheus URL is blocked

See merge request gitlab-org/gitlab!24743
parents d8ecb38d 41f645d1
...@@ -99,6 +99,8 @@ module Clusters ...@@ -99,6 +99,8 @@ module Clusters
def configured? def configured?
kube_client.present? && available? kube_client.present? && available?
rescue Gitlab::UrlBlocker::BlockedUrlError
false
end end
private private
......
---
title: Fix job page not loading because kuberenetes/prometheus URL is blocked
merge_request: 24743
author:
type: fixed
...@@ -4,6 +4,7 @@ require 'spec_helper' ...@@ -4,6 +4,7 @@ require 'spec_helper'
describe Clusters::Applications::Prometheus do describe Clusters::Applications::Prometheus do
include KubernetesHelpers include KubernetesHelpers
include StubRequests
include_examples 'cluster application core specs', :clusters_applications_prometheus include_examples 'cluster application core specs', :clusters_applications_prometheus
include_examples 'cluster application status specs', :clusters_applications_prometheus include_examples 'cluster application status specs', :clusters_applications_prometheus
...@@ -320,6 +321,16 @@ describe Clusters::Applications::Prometheus do ...@@ -320,6 +321,16 @@ describe Clusters::Applications::Prometheus do
it { is_expected.to be_falsey } it { is_expected.to be_falsey }
end end
context 'when the kubernetes URL is blocked' do
before do
blocked_ip = '127.0.0.1' # localhost addresses are blocked by default
stub_all_dns(cluster.platform.api_url, ip_address: blocked_ip)
end
it { is_expected.to be_falsey }
end
end end
context 'when a kubenetes client is not present' do context 'when a kubenetes client is not present' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment