Commit 85a23bbe authored by Thong Kuah's avatar Thong Kuah

Fix Ruby 2.7 keyword parameter warning in Cluster specs

Related to https://gitlab.com/gitlab-org/gitlab/-/issues/257438
parent 36ad9f91
......@@ -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)
......
......@@ -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)
......
......@@ -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)
......
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