lib/command/cleanup_stale_apps.rb in cpl-1.0.4 vs lib/command/cleanup_stale_apps.rb in cpl-1.1.0
- old
+ new
@@ -47,10 +47,10 @@
gvcs = cp.gvc_query(config.app)["items"]
gvcs.each do |gvc|
app_name = gvc["name"]
- images = cp.image_query(app_name)["items"].filter { |item| item["name"].start_with?("#{app_name}:") }
+ images = cp.query_images(app_name)["items"].select { |item| item["name"].start_with?("#{app_name}:") }
image = latest_image_from(images, app_name: app_name, name_only: false)
next unless image
created_date = DateTime.parse(image["created"])
diff_in_days = (now - created_date).to_i