diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/support/helpers/kubernetes_helpers.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/support/helpers/kubernetes_helpers.rb')
-rw-r--r-- | spec/support/helpers/kubernetes_helpers.rb | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spec/support/helpers/kubernetes_helpers.rb b/spec/support/helpers/kubernetes_helpers.rb index 912e7d24b25..72524453f34 100644 --- a/spec/support/helpers/kubernetes_helpers.rb +++ b/spec/support/helpers/kubernetes_helpers.rb @@ -142,6 +142,29 @@ module KubernetesHelpers WebMock.stub_request(method, ingresses_url).to_return(response) end + def stub_server_min_version_failed_request + WebMock.stub_request(:get, service.api_url + '/version').to_return( + status: [500, "Internal Server Error"], + body: {}.to_json) + end + + def stub_server_min_version(min_version) + response = kube_response({ + "major": "1", # not used, just added here to be a bit more realistic purposes + "minor": min_version.to_s + }) + + WebMock.stub_request( :get, service.api_url + '/version') + .with( + headers: { + 'Accept' => '*/*', + 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', + 'Authorization' => 'Bearer aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', + 'User-Agent' => 'Ruby' + }) + .to_return(response) + end + def stub_kubeclient_knative_services(options = {}) namespace_path = options[:namespace].present? ? "namespaces/#{options[:namespace]}/" : "" @@ -537,7 +560,7 @@ module KubernetesHelpers }, "spec" => { "containers" => [ - { "name" => "#{container_name}" }, + { "name" => container_name.to_s }, { "name" => "#{container_name}-1" } ] }, |