lib/k8s_kit/context.rb in k8s_kit-0.0.2 vs lib/k8s_kit/context.rb in k8s_kit-0.0.3
- old
+ new
@@ -44,9 +44,14 @@
t0 = Time.now
print 'Waiting for all pods to be ready...'
loop do
statuses = run('get pods -o jsonpath="{.items.*.status.containerStatuses[*].ready}"')
+ if statuses.empty?
+ puts ''
+ raise StandardError, 'No pod could be found in the namespace'
+ end
+
return unless statuses.include?('false')
if t0 + timeout < Time.now
puts ''
raise StandardError, 'Timeout while waiting for pods to become ready'