Commit 63379a2a authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '46259-prometheus-integration-fails-on-kube-1-10' into 'master'

Resolve "Prometheus integration fails on k8s 1.10"

Closes #46259

See merge request gitlab-org/gitlab-ce!19082
parents 31413f4c 7a73cff7
class Kubeclient::Client
# We need to monkey patch this method until
# https://github.com/abonas/kubeclient/pull/323 is merged
def proxy_url(kind, name, port, namespace = '')
discover unless @discovered
entity_name_plural =
if %w[services pods nodes].include?(kind.to_s)
kind.to_s
else
@entities[kind.to_s].resource_name
end
ns_prefix = build_namespace_prefix(namespace)
rest_client["#{ns_prefix}#{entity_name_plural}/#{name}:#{port}/proxy"].url
end
end
...@@ -79,7 +79,7 @@ describe Clusters::Applications::Prometheus do ...@@ -79,7 +79,7 @@ describe Clusters::Applications::Prometheus do
end end
it 'creates proper url' do it 'creates proper url' do
expect(subject.prometheus_client.url).to eq('http://example.com/api/v1/proxy/namespaces/gitlab-managed-apps/service/prometheus-prometheus-server:80') expect(subject.prometheus_client.url).to eq('http://example.com/api/v1/namespaces/gitlab-managed-apps/service/prometheus-prometheus-server:80/proxy')
end end
it 'copies options and headers from kube client to proxy client' do it 'copies options and headers from kube client to proxy client' 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