kubernetes-deploy 0.15.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47534a160d32999369931589fe698e7befe31d12
|
4
|
+
data.tar.gz: 7cf8a851a0d0bcfb6d914358d0a973fa3296e875
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0f6e54b90c9774f0e5b2b5f4d286c8bcd407e4547fc8555c2068b710718a66fc87dcf3f859c597f4ddbab9f38cb5390f00cf8b40837857661340c73e4631ae3
|
7
|
+
data.tar.gz: 3f55e5cbfcef2022c50d15394af1e52678252aca7195ff924d89a4cd444978e793283f63e426c849b6c17d3a571aed09f13bb010302833844c3bdb99aa7519e9
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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
|
170
|
-
|
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 =
|
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
|