Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e36dea90
Commit
e36dea90
authored
Oct 06, 2020
by
Igor Drozdov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Ruby 2.7 warnings for Cloud Platform
Replace kwargs with options hash
parent
104512a8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
12 deletions
+9
-12
lib/google_api/cloud_platform/client.rb
lib/google_api/cloud_platform/client.rb
+1
-1
spec/services/clusters/gcp/finalize_creation_service_spec.rb
spec/services/clusters/gcp/finalize_creation_service_spec.rb
+1
-4
spec/support/google_api/cloud_platform_helpers.rb
spec/support/google_api/cloud_platform_helpers.rb
+7
-7
No files found.
lib/google_api/cloud_platform/client.rb
View file @
e36dea90
...
...
@@ -66,7 +66,7 @@ module GoogleApi
cluster_options
=
make_cluster_options
(
cluster_name
,
cluster_size
,
machine_type
,
legacy_abac
,
enable_addons
)
request_body
=
Google
::
Apis
::
ContainerV1beta1
::
CreateClusterRequest
.
new
(
cluster_options
)
request_body
=
Google
::
Apis
::
ContainerV1beta1
::
CreateClusterRequest
.
new
(
**
cluster_options
)
service
.
create_cluster
(
project_id
,
zone
,
request_body
,
options:
user_agent_header
)
end
...
...
spec/services/clusters/gcp/finalize_creation_service_spec.rb
View file @
e36dea90
...
...
@@ -83,10 +83,7 @@ RSpec.describe Clusters::Gcp::FinalizeCreationService, '#execute' do
shared_context
'kubernetes information successfully fetched'
do
before
do
stub_cloud_platform_get_zone_cluster
(
provider
.
gcp_project_id
,
provider
.
zone
,
cluster
.
name
,
endpoint:
endpoint
,
username:
username
,
password:
password
provider
.
gcp_project_id
,
provider
.
zone
,
cluster
.
name
,
{
endpoint:
endpoint
,
username:
username
,
password:
password
}
)
stub_kubeclient_discover
(
api_url
)
...
...
spec/support/google_api/cloud_platform_helpers.rb
View file @
e36dea90
...
...
@@ -22,9 +22,9 @@ module GoogleApi
.
to_return
(
cloud_platform_response
(
cloud_platform_projects_billing_info_body
(
project_id
,
billing_enabled
)))
end
def
stub_cloud_platform_get_zone_cluster
(
project_id
,
zone
,
cluster_id
,
**
options
)
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
)
...
...
@@ -32,7 +32,7 @@ module GoogleApi
.
to_return
(
status:
[
500
,
"Internal Server Error"
])
end
def
stub_cloud_platform_create_cluster
(
project_id
,
zone
,
**
options
)
def
stub_cloud_platform_create_cluster
(
project_id
,
zone
,
options
=
{}
)
WebMock
.
stub_request
(
:post
,
cloud_platform_create_cluster_url
(
project_id
,
zone
))
.
to_return
(
cloud_platform_response
(
cloud_platform_operation_body
(
options
)))
end
...
...
@@ -42,7 +42,7 @@ module GoogleApi
.
to_return
(
status:
[
500
,
"Internal Server Error"
])
end
def
stub_cloud_platform_get_zone_operation
(
project_id
,
zone
,
operation_id
,
**
options
)
def
stub_cloud_platform_get_zone_operation
(
project_id
,
zone
,
operation_id
,
options
=
{}
)
WebMock
.
stub_request
(
:get
,
cloud_platform_get_zone_operation_url
(
project_id
,
zone
,
operation_id
))
.
to_return
(
cloud_platform_response
(
cloud_platform_operation_body
(
options
)))
end
...
...
@@ -86,7 +86,7 @@ module GoogleApi
# https://cloud.google.com/kubernetes-engine/docs/reference/rest/v1/projects.zones.clusters/create
# rubocop:disable Metrics/CyclomaticComplexity
# rubocop:disable Metrics/PerceivedComplexity
def
cloud_platform_cluster_body
(
**
options
)
def
cloud_platform_cluster_body
(
options
)
{
"name"
:
options
[
:name
]
||
'string'
,
"description"
:
options
[
:description
]
||
'string'
,
...
...
@@ -121,7 +121,7 @@ module GoogleApi
}
end
def
cloud_platform_operation_body
(
**
options
)
def
cloud_platform_operation_body
(
options
)
{
"name"
:
options
[
:name
]
||
'operation-1234567891234-1234567'
,
"zone"
:
options
[
:zone
]
||
'us-central1-a'
,
...
...
@@ -136,7 +136,7 @@ module GoogleApi
}
end
def
cloud_platform_projects_body
(
**
options
)
def
cloud_platform_projects_body
(
options
)
{
"projects"
:
[
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment