diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 11:27:35 +0300 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /spec/lib/gitlab/kubernetes/kube_client_spec.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'spec/lib/gitlab/kubernetes/kube_client_spec.rb')
-rw-r--r-- | spec/lib/gitlab/kubernetes/kube_client_spec.rb | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/spec/lib/gitlab/kubernetes/kube_client_spec.rb b/spec/lib/gitlab/kubernetes/kube_client_spec.rb index 7b6d143dda9..521f13dc9cc 100644 --- a/spec/lib/gitlab/kubernetes/kube_client_spec.rb +++ b/spec/lib/gitlab/kubernetes/kube_client_spec.rb @@ -19,7 +19,7 @@ RSpec.describe Gitlab::Kubernetes::KubeClient do case method_name when /\A(get_|delete_)/ client.public_send(method_name) - when /\A(create_|update_)/ + when /\A(create_|update_|patch_)/ client.public_send(method_name, {}) else raise "Unknown method name #{method_name}" @@ -302,6 +302,8 @@ RSpec.describe Gitlab::Kubernetes::KubeClient do :create_role, :get_role, :update_role, + :delete_role_binding, + :update_role_binding, :update_cluster_role_binding ].each do |method| describe "##{method}" do @@ -375,6 +377,34 @@ RSpec.describe Gitlab::Kubernetes::KubeClient do end end + describe '#patch_ingress' do + let(:extensions_client) { client.extensions_client } + let(:networking_client) { client.networking_client } + + include_examples 'redirection not allowed', 'patch_ingress' + include_examples 'dns rebinding not allowed', 'patch_ingress' + + it 'delegates to the extensions client' do + expect(extensions_client).to receive(:patch_ingress) + + client.patch_ingress + end + + context 'extensions does not have ingress for Kubernetes 1.22+ clusters' do + before do + WebMock + .stub_request(:get, api_url + '/apis/extensions/v1beta1') + .to_return(kube_response(kube_1_22_extensions_v1beta1_discovery_body)) + end + + it 'delegates to the apps client' do + expect(networking_client).to receive(:patch_ingress) + + client.patch_ingress + end + end + end + describe 'istio API group' do let(:istio_client) { client.istio_client } |