lib/command/base.rb in cpl-0.7.0 vs lib/command/base.rb in cpl-1.0.0
- old
+ new
@@ -185,31 +185,25 @@
option[:params][:aliases]&.each { |current_alias| result[current_alias.to_s] = option }
result["--#{option[:name]}"] = option
end
end
- def wait_for(title)
- progress.print "- Waiting for #{title}"
- until yield
- progress.print(".")
- sleep(1)
+ def wait_for_workload(workload)
+ step("Waiting for workload", retry_on_failure: true) do
+ cp.fetch_workload(workload)
end
- progress.puts
end
- def wait_for_workload(workload)
- wait_for("workload to start") { cp.fetch_workload(workload) }
- end
-
def wait_for_replica(workload, location)
- wait_for("replica") do
+ step("Waiting for replica", retry_on_failure: true) do
cp.workload_get_replicas_safely(workload, location: location)&.dig("items", 0)
end
end
def ensure_workload_deleted(workload)
- progress.puts "- Ensure workload is deleted"
- cp.delete_workload(workload)
+ step("Deleting workload") do
+ cp.delete_workload(workload)
+ end
end
def latest_image_from(items, app_name: config.app, name_only: true)
matching_items = items.filter { |item| item["name"].start_with?("#{app_name}:") }