diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2019-01-25 14:00:54 +0300 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2019-01-25 14:00:54 +0300 |
commit | 53b8e6e3890efdb8db132559d35ff231f2aaf71d (patch) | |
tree | 470a18e90816bea353db0fa6c013cbdc3cd115d3 /lib | |
parent | 552f80328351b11ce9845448110f2db3afc09a2b (diff) | |
parent | f234aef9943ec7ccd3e30e55d6cd0acd114e6c29 (diff) |
Merge branch '54250-upstream-kubeclient-redirect-patch' into 'master'
Use http_max_redirects opt to replace monkeypatch
Closes #54250
See merge request gitlab-org/gitlab-ce!24284
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/kubernetes/kube_client.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/kubernetes/kube_client.rb b/lib/gitlab/kubernetes/kube_client.rb index fe839940f74..624c2c67551 100644 --- a/lib/gitlab/kubernetes/kube_client.rb +++ b/lib/gitlab/kubernetes/kube_client.rb @@ -76,9 +76,12 @@ module Gitlab attr_reader :api_prefix, :kubeclient_options + # We disable redirects through 'http_max_redirects: 0', + # so that KubeClient does not follow redirects and + # expose internal services. def initialize(api_prefix, **kubeclient_options) @api_prefix = api_prefix - @kubeclient_options = kubeclient_options + @kubeclient_options = kubeclient_options.merge(http_max_redirects: 0) end def create_or_update_cluster_role_binding(resource) |