summaryrefslogtreecommitdiff
path: root/lib/quality/kubernetes_client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/quality/kubernetes_client.rb')
-rw-r--r--lib/quality/kubernetes_client.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/quality/kubernetes_client.rb b/lib/quality/kubernetes_client.rb
index 190b48ba7cb..cc899bf9374 100644
--- a/lib/quality/kubernetes_client.rb
+++ b/lib/quality/kubernetes_client.rb
@@ -12,7 +12,16 @@ module Quality
@namespace = namespace
end
- def cleanup(release_name:)
+ def cleanup(release_name:, wait: true)
+ selector = case release_name
+ when String
+ %(-l release="#{release_name}")
+ when Array
+ %(-l 'release in (#{release_name.join(', ')})')
+ else
+ raise ArgumentError, 'release_name must be a string or an array'
+ end
+
command = [
%(--namespace "#{namespace}"),
'delete',
@@ -20,7 +29,8 @@ module Quality
'--now',
'--ignore-not-found',
'--include-uninitialized',
- %(-l release="#{release_name}")
+ %(--wait=#{wait}),
+ selector
]
run_command(command)