Commit aa03fc2e authored by Nick Thomas's avatar Nick Thomas

Merge branch 'fix_clusters_specs_2_7_keyword' into 'master'

Fix Ruby 2.7 keyword parameter warning in Cluster specs

See merge request gitlab-org/gitlab!43512
parents e07e69c1 ad4ea8b5
......@@ -17,11 +17,9 @@ RSpec.describe API::ProjectClusters do
stub_kubeclient_get_secret(
api_url,
{
metadata_name: "#{namespace}-token",
token: Base64.encode64('sample-token'),
namespace: namespace
}
metadata_name: "#{namespace}-token",
token: Base64.encode64('sample-token'),
namespace: namespace
)
stub_kubeclient_put_secret(api_url, "#{namespace}-token", namespace: namespace)
......
......@@ -206,7 +206,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.5.0' do
before do
prepare_knative_stubs(knative_05_service(knative_stub_options))
prepare_knative_stubs(knative_05_service(**knative_stub_options))
end
include_examples 'GET #show with valid data'
......@@ -214,7 +214,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.6.0' do
before do
prepare_knative_stubs(knative_06_service(knative_stub_options))
prepare_knative_stubs(knative_06_service(**knative_stub_options))
end
include_examples 'GET #show with valid data'
......@@ -222,7 +222,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.7.0' do
before do
prepare_knative_stubs(knative_07_service(knative_stub_options))
prepare_knative_stubs(knative_07_service(**knative_stub_options))
end
include_examples 'GET #show with valid data'
......@@ -230,7 +230,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.9.0' do
before do
prepare_knative_stubs(knative_09_service(knative_stub_options))
prepare_knative_stubs(knative_09_service(**knative_stub_options))
end
include_examples 'GET #show with valid data'
......@@ -275,7 +275,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.5.0' do
before do
prepare_knative_stubs(knative_05_service(knative_stub_options))
prepare_knative_stubs(knative_05_service(**knative_stub_options))
end
include_examples 'GET #index with data'
......@@ -283,7 +283,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.6.0' do
before do
prepare_knative_stubs(knative_06_service(knative_stub_options))
prepare_knative_stubs(knative_06_service(**knative_stub_options))
end
include_examples 'GET #index with data'
......@@ -291,7 +291,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.7.0' do
before do
prepare_knative_stubs(knative_07_service(knative_stub_options))
prepare_knative_stubs(knative_07_service(**knative_stub_options))
end
include_examples 'GET #index with data'
......@@ -299,7 +299,7 @@ RSpec.describe Projects::Serverless::FunctionsController do
context 'on Knative 0.9.0' do
before do
prepare_knative_stubs(knative_09_service(knative_stub_options))
prepare_knative_stubs(knative_09_service(**knative_stub_options))
end
include_examples 'GET #index with data'
......
......@@ -84,11 +84,9 @@ RSpec.describe Clusters::Gcp::FinalizeCreationService, '#execute' do
before do
stub_cloud_platform_get_zone_cluster(
provider.gcp_project_id, provider.zone, cluster.name,
{
endpoint: endpoint,
username: username,
password: password
}
endpoint: endpoint,
username: username,
password: password
)
stub_kubeclient_discover(api_url)
......@@ -101,11 +99,9 @@ RSpec.describe Clusters::Gcp::FinalizeCreationService, '#execute' do
stub_kubeclient_get_secret(
api_url,
{
metadata_name: secret_name,
token: Base64.encode64(token),
namespace: 'default'
}
metadata_name: secret_name,
token: Base64.encode64(token),
namespace: 'default'
)
stub_kubeclient_put_cluster_role_binding(api_url, 'gitlab-admin')
......
......@@ -26,27 +26,21 @@ RSpec.describe Clusters::Kubernetes::ConfigureIstioIngressService, '#execute' do
stub_kubeclient_get_secret(
api_url,
{
metadata_name: "#{namespace}-token",
token: Base64.encode64('sample-token'),
namespace: namespace
}
metadata_name: "#{namespace}-token",
token: Base64.encode64('sample-token'),
namespace: namespace
)
stub_kubeclient_get_secret(
api_url,
{
metadata_name: 'istio-ingressgateway-ca-certs',
namespace: 'istio-system'
}
metadata_name: 'istio-ingressgateway-ca-certs',
namespace: 'istio-system'
)
stub_kubeclient_get_secret(
api_url,
{
metadata_name: 'istio-ingressgateway-certs',
namespace: 'istio-system'
}
metadata_name: 'istio-ingressgateway-certs',
namespace: 'istio-system'
)
stub_kubeclient_put_secret(api_url, 'istio-ingressgateway-ca-certs', namespace: 'istio-system')
......
......@@ -41,11 +41,9 @@ RSpec.describe Clusters::Kubernetes::CreateOrUpdateNamespaceService, '#execute'
stub_kubeclient_get_secret(
api_url,
{
metadata_name: "#{namespace}-token",
token: Base64.encode64('sample-token'),
namespace: namespace
}
metadata_name: "#{namespace}-token",
token: Base64.encode64('sample-token'),
namespace: namespace
)
end
......
......@@ -31,11 +31,9 @@ RSpec.describe Clusters::Kubernetes::FetchKubernetesTokenService do
before do
stub_kubeclient_get_secret(
api_url,
{
metadata_name: service_account_token_name,
namespace: namespace,
token: token
}
metadata_name: service_account_token_name,
namespace: namespace,
token: token
)
end
......@@ -54,11 +52,9 @@ RSpec.describe Clusters::Kubernetes::FetchKubernetesTokenService do
before do
stub_kubeclient_get_secret_not_found_then_found(
api_url,
{
metadata_name: service_account_token_name,
namespace: namespace,
token: token
}
metadata_name: service_account_token_name,
namespace: namespace,
token: token
)
end
......@@ -96,11 +92,9 @@ RSpec.describe Clusters::Kubernetes::FetchKubernetesTokenService do
before do
stub_kubeclient_get_secret(
api_url,
{
metadata_name: service_account_token_name,
namespace: namespace,
token: nil
}
metadata_name: service_account_token_name,
namespace: namespace,
token: nil
)
end
......
......@@ -24,7 +24,7 @@ module GoogleApi
def stub_cloud_platform_get_zone_cluster(project_id, zone, cluster_id, **options)
WebMock.stub_request(:get, cloud_platform_get_zone_cluster_url(project_id, zone, cluster_id))
.to_return(cloud_platform_response(cloud_platform_cluster_body(options)))
.to_return(cloud_platform_response(cloud_platform_cluster_body(**options)))
end
def stub_cloud_platform_get_zone_cluster_error(project_id, zone, cluster_id)
......
......@@ -153,7 +153,7 @@ module KubernetesHelpers
options[:name] ||= "kubetest"
options[:domain] ||= "example.com"
options[:response] ||= kube_response(kube_knative_services_body(options))
options[:response] ||= kube_response(kube_knative_services_body(**options))
stub_kubeclient_discover(service.api_url)
......@@ -167,7 +167,7 @@ module KubernetesHelpers
options[:namespace] ||= "default"
WebMock.stub_request(:get, api_url + "/api/v1/namespaces/#{options[:namespace]}/secrets/#{options[:metadata_name]}")
.to_return(kube_response(kube_v1_secret_body(options)))
.to_return(kube_response(kube_v1_secret_body(**options)))
end
def stub_kubeclient_get_secret_error(api_url, name, namespace: 'default', status: 404)
......@@ -517,7 +517,7 @@ module KubernetesHelpers
def kube_knative_services_body(**options)
{
"kind" => "List",
"items" => [knative_09_service(options)]
"items" => [knative_09_service(**options)]
}
end
......
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