Browse Source

Don't swallow exceptions when doing tiller actions

Change-Id: I83d4c185106a2ace602fe950dcb25b86f51748bb
Vladyslav Drok 5 months ago
parent
commit
1986a935f6
1 changed files with 17 additions and 3 deletions
  1. 17
    3
      armada/handlers/tiller.py

+ 17
- 3
armada/handlers/tiller.py View File

@@ -127,6 +127,7 @@ class Tiller(object):
127 127
                          ('grpc.max_receive_message_length',
128 128
                           MAX_MESSAGE_LENGTH)])
129 129
         except Exception:
130
+            LOG.exception('Failed to initialize grpc channel to tiller.')
130 131
             raise ex.ChannelException()
131 132
 
132 133
     def _get_tiller_pod(self):
@@ -312,7 +313,12 @@ class Tiller(object):
312 313
                     name, release_name, namespace, labels, action_type, chart,
313 314
                     disable_hooks, values, timeout)
314 315
         except Exception:
315
-            LOG.warn("Pre: Could not update anything, please check yaml")
316
+            LOG.excpetion(
317
+                "Pre-action failure: could not perform rolling upgrade for "
318
+                "%(res_type)s %(res_name)s.", {
319
+                    'res_type': action_type,
320
+                    'res_name': name
321
+                })
316 322
             raise ex.PreUpdateJobDeleteException(name, namespace)
317 323
 
318 324
         try:
@@ -329,7 +335,12 @@ class Tiller(object):
329 335
                     namespace,
330 336
                     timeout=timeout)
331 337
         except Exception:
332
-            LOG.warn("PRE: Could not delete anything, please check yaml")
338
+            LOG.excpetion(
339
+                "Pre-action failure: could not delete %(res_type)s "
340
+                "%(res_name)s.", {
341
+                    'res_type': action_type,
342
+                    'res_name': name
343
+                })
333 344
             raise ex.PreUpdateJobDeleteException(name, namespace)
334 345
 
335 346
     def list_charts(self):
@@ -530,6 +541,7 @@ class Tiller(object):
530 541
             return release_status
531 542
 
532 543
         except Exception:
544
+            LOG.exception('Cannot get tiller release status.')
533 545
             raise ex.GetReleaseStatusException(release, version)
534 546
 
535 547
     def get_release_content(self, release, version=0):
@@ -551,6 +563,7 @@ class Tiller(object):
551 563
             return release_content
552 564
 
553 565
         except Exception:
566
+            LOG.exception('Cannot get tiller release content.')
554 567
             raise ex.GetReleaseContentException(release, version)
555 568
 
556 569
     def tiller_version(self):
@@ -570,7 +583,7 @@ class Tiller(object):
570 583
             return tiller_version
571 584
 
572 585
         except Exception:
573
-            LOG.debug('Failed to get Tiller version')
586
+            LOG.exception('Failed to get Tiller version.')
574 587
             raise ex.TillerVersionException()
575 588
 
576 589
     def uninstall_release(self, release, disable_hooks=False, purge=True):
@@ -794,6 +807,7 @@ class Tiller(object):
794 807
             return
795 808
 
796 809
         except Exception:
810
+            LOG.exception('Error while rolling back tiller release.')
797 811
             raise ex.RollbackReleaseException(release_name, version)
798 812
 
799 813
     def _check_timeout(self, wait, timeout):

Loading…
Cancel
Save