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
d1a193a6
Commit
d1a193a6
authored
Feb 18, 2020
by
Albert Salim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore not found when deleting k8s resource by name
parent
4833bc80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lib/quality/kubernetes_client.rb
lib/quality/kubernetes_client.rb
+2
-1
spec/lib/quality/kubernetes_client_spec.rb
spec/lib/quality/kubernetes_client_spec.rb
+3
-3
No files found.
lib/quality/kubernetes_client.rb
View file @
d1a193a6
...
@@ -48,7 +48,8 @@ module Quality
...
@@ -48,7 +48,8 @@ module Quality
resource_names
=
raw_resource_names
resource_names
=
raw_resource_names
command
=
[
command
=
[
'delete'
,
'delete'
,
%(--namespace "#{namespace}")
%(--namespace "#{namespace}")
,
'--ignore-not-found'
]
]
Array
(
release_name
).
each
do
|
release
|
Array
(
release_name
).
each
do
|
release
|
...
...
spec/lib/quality/kubernetes_client_spec.rb
View file @
d1a193a6
...
@@ -38,7 +38,7 @@ RSpec.describe Quality::KubernetesClient do
...
@@ -38,7 +38,7 @@ RSpec.describe Quality::KubernetesClient do
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen_with_detail
)
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen_with_detail
)
.
with
([
%(kubectl delete --namespace "#{namespace}" #{pod_for_release})
])
.
with
([
%(kubectl delete --namespace "#{namespace}"
--ignore-not-found
#{pod_for_release})
])
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
# We're not verifying the output here, just silencing it
# We're not verifying the output here, just silencing it
...
@@ -64,7 +64,7 @@ RSpec.describe Quality::KubernetesClient do
...
@@ -64,7 +64,7 @@ RSpec.describe Quality::KubernetesClient do
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen_with_detail
)
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen_with_detail
)
.
with
([
%(kubectl delete --namespace "#{namespace}" #{pod_for_release})
])
.
with
([
%(kubectl delete --namespace "#{namespace}"
--ignore-not-found
#{pod_for_release})
])
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
# We're not verifying the output here, just silencing it
# We're not verifying the output here, just silencing it
...
@@ -89,7 +89,7 @@ RSpec.describe Quality::KubernetesClient do
...
@@ -89,7 +89,7 @@ RSpec.describe Quality::KubernetesClient do
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen_with_detail
)
expect
(
Gitlab
::
Popen
).
to
receive
(
:popen_with_detail
)
.
with
([
%(kubectl delete --namespace "#{namespace}" #{pod_for_release})
])
.
with
([
%(kubectl delete --namespace "#{namespace}"
--ignore-not-found
#{pod_for_release})
])
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
.
and_return
(
Gitlab
::
Popen
::
Result
.
new
([],
''
,
''
,
double
(
success?:
true
)))
# We're not verifying the output here, just silencing it
# We're not verifying the output here, just silencing it
...
...
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