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
ad138e9c
Commit
ad138e9c
authored
Oct 06, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Ruby 2.7 warnings in spec/support/helpers/kubernetes_helpers.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
4f6ec9c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
7 deletions
+5
-7
spec/services/clusters/kubernetes/fetch_kubernetes_token_service_spec.rb
...lusters/kubernetes/fetch_kubernetes_token_service_spec.rb
+3
-5
spec/support/helpers/kubernetes_helpers.rb
spec/support/helpers/kubernetes_helpers.rb
+2
-2
No files found.
spec/services/clusters/kubernetes/fetch_kubernetes_token_service_spec.rb
View file @
ad138e9c
...
@@ -75,11 +75,9 @@ RSpec.describe Clusters::Kubernetes::FetchKubernetesTokenService do
...
@@ -75,11 +75,9 @@ RSpec.describe Clusters::Kubernetes::FetchKubernetesTokenService do
before
do
before
do
stub_kubeclient_get_secret_missing_token_then_with_token
(
stub_kubeclient_get_secret_missing_token_then_with_token
(
api_url
,
api_url
,
{
metadata_name:
service_account_token_name
,
metadata_name:
service_account_token_name
,
namespace:
namespace
,
namespace:
namespace
,
token:
token
token:
token
}
)
)
end
end
...
...
spec/support/helpers/kubernetes_helpers.rb
View file @
ad138e9c
...
@@ -167,7 +167,7 @@ module KubernetesHelpers
...
@@ -167,7 +167,7 @@ module KubernetesHelpers
options
[
:namespace
]
||=
"default"
options
[
:namespace
]
||=
"default"
WebMock
.
stub_request
(
:get
,
api_url
+
"/api/v1/namespaces/
#{
options
[
:namespace
]
}
/secrets/
#{
options
[
:metadata_name
]
}
"
)
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
end
def
stub_kubeclient_get_secret_error
(
api_url
,
name
,
namespace:
'default'
,
status:
404
)
def
stub_kubeclient_get_secret_error
(
api_url
,
name
,
namespace:
'default'
,
status:
404
)
...
@@ -265,7 +265,7 @@ module KubernetesHelpers
...
@@ -265,7 +265,7 @@ module KubernetesHelpers
.
to_return
(
kube_response
({}))
.
to_return
(
kube_response
({}))
end
end
def
kube_v1_secret_body
(
**
options
)
def
kube_v1_secret_body
(
options
)
{
{
"kind"
=>
"SecretList"
,
"kind"
=>
"SecretList"
,
"apiVersion"
:
"v1"
,
"apiVersion"
:
"v1"
,
...
...
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