kubernetes-deploy 0.15.0 → 0.15.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f73fbf31b907e647a5c5fb9f37672cda04f2fbb
4
- data.tar.gz: 37ff614545966a6aed17f814e71f244ec571c0de
3
+ metadata.gz: 47534a160d32999369931589fe698e7befe31d12
4
+ data.tar.gz: 7cf8a851a0d0bcfb6d914358d0a973fa3296e875
5
5
  SHA512:
6
- metadata.gz: da6efb2e3f67dcb4e322559fb39deaa2d87606269cb1f1ab1f1609cc4a01d7af766e0bae0483a1ad448143de4f3db80a81938221a9bff6daefb4e475c0400d11
7
- data.tar.gz: 5991bc3e2dc085d46c28ad3c11fc057cf9bbc79785cd2b92bef41b9d637e96b2b74650852ab7bdc574f1f3b8d55ea7a3513e94440fe360292c3dc876833b46f8
6
+ metadata.gz: f0f6e54b90c9774f0e5b2b5f4d286c8bcd407e4547fc8555c2068b710718a66fc87dcf3f859c597f4ddbab9f38cb5390f00cf8b40837857661340c73e4631ae3
7
+ data.tar.gz: 3f55e5cbfcef2022c50d15394af1e52678252aca7195ff924d89a4cd444978e793283f63e426c849b6c17d3a571aed09f13bb010302833844c3bdb99aa7519e9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 0.15.1
2
+ *Enhancements*
3
+ - Fetch debug events and logs for failed resources in parallel ([#238](https://github.com/Shopify/kubernetes-deploy/pull/238))
4
+
1
5
  ### 0.15.0
2
6
  *Bug Fixes*
3
7
  - None
@@ -140,7 +140,15 @@ module KubernetesDeploy
140
140
  :apply
141
141
  end
142
142
 
143
+ def sync_debug_info
144
+ @events = fetch_events
145
+ @logs = fetch_logs if supports_logs?
146
+ @debug_info_synced = true
147
+ end
148
+
143
149
  def debug_message
150
+ sync_debug_info unless @debug_info_synced
151
+
144
152
  helpful_info = []
145
153
  if deploy_failed?
146
154
  helpful_info << ColorizedString.new("#{id}: FAILED").red
@@ -156,22 +164,20 @@ module KubernetesDeploy
156
164
  end
157
165
  helpful_info << " - Final status: #{status}"
158
166
 
159
- events = fetch_events
160
- if events.present?
167
+ if @events.present?
161
168
  helpful_info << " - Events (common success events excluded):"
162
- events.each do |identifier, event_hashes|
169
+ @events.each do |identifier, event_hashes|
163
170
  event_hashes.each { |event| helpful_info << " [#{identifier}]\t#{event}" }
164
171
  end
165
172
  else
166
173
  helpful_info << " - Events: #{DEBUG_RESOURCE_NOT_FOUND_MESSAGE}"
167
174
  end
168
175
 
169
- if respond_to?(:fetch_logs)
170
- container_logs = fetch_logs
171
- if container_logs.blank? || container_logs.values.all?(&:blank?)
176
+ if supports_logs?
177
+ if @logs.blank? || @logs.values.all?(&:blank?)
172
178
  helpful_info << " - Logs: #{DEBUG_RESOURCE_NOT_FOUND_MESSAGE}"
173
179
  else
174
- sorted_logs = container_logs.sort_by { |_, log_lines| log_lines.length }
180
+ sorted_logs = @logs.sort_by { |_, log_lines| log_lines.length }
175
181
  sorted_logs.each do |identifier, log_lines|
176
182
  if log_lines.empty?
177
183
  helpful_info << " - Logs from container '#{identifier}': #{DEBUG_RESOURCE_NOT_FOUND_MESSAGE}"
@@ -322,6 +328,10 @@ module KubernetesDeploy
322
328
  file&.close
323
329
  end
324
330
 
331
+ def supports_logs?
332
+ respond_to?(:fetch_logs)
333
+ end
334
+
325
335
  def statsd_tags
326
336
  status = if deploy_failed?
327
337
  "failure"
@@ -82,6 +82,7 @@ module KubernetesDeploy
82
82
 
83
83
  if fail_count > 0
84
84
  @logger.summary.add_action("failed to #{@operation_name} #{fail_count} #{'resource'.pluralize(fail_count)}")
85
+ KubernetesDeploy::Concurrency.split_across_threads(failed_resources, &:sync_debug_info)
85
86
  failed_resources.each { |r| @logger.summary.add_paragraph(r.debug_message) }
86
87
  end
87
88
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module KubernetesDeploy
3
- VERSION = "0.15.0"
3
+ VERSION = "0.15.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Verey