Browse Source

tiller: Remove unused params from delete_resources

Parameters `release_name` and `name` are ignored by the Tiller handler's
`delete_resources` method because the deletions are handled using labels
rather than by name. Currently, values that do not represent the
parameters are being passed to the method, which sometimes leads to
cryptic logging messages. This change removes all references to the
aforementioned parameters and clarifies the corresponding docstring and
log message.

Change-Id: Ic43819a273bf9da5e8965f409a56307eb11b4922
Drew Walters 5 months ago
parent
commit
5cafd027b5
1 changed files with 8 additions and 18 deletions
  1. 8
    18
      armada/handlers/tiller.py

+ 8
- 18
armada/handlers/tiller.py View File

@@ -328,12 +328,7 @@ class Tiller(object):
328 328
                 labels = action.get('labels', None)
329 329
 
330 330
                 self.delete_resources(
331
-                    release_name,
332
-                    name,
333
-                    action_type,
334
-                    labels,
335
-                    namespace,
336
-                    timeout=timeout)
331
+                    action_type, labels, namespace, timeout=timeout)
337 332
         except Exception:
338 333
             LOG.excpetion(
339 334
                 "Pre-action failure: could not delete %(res_type)s "
@@ -621,21 +616,18 @@ class Tiller(object):
621 616
             raise ex.ReleaseException(release, status, 'Delete')
622 617
 
623 618
     def delete_resources(self,
624
-                         release_name,
625
-                         resource_name,
626 619
                          resource_type,
627 620
                          resource_labels,
628 621
                          namespace,
629 622
                          wait=False,
630 623
                          timeout=const.DEFAULT_TILLER_TIMEOUT):
631 624
         '''
632
-        :param release_name: release name the specified resource is under
633
-        :param resource_name: name of specific resource
634
-        :param resource_type: type of resource e.g. job, pod, etc.
635
-        :param resource_labels: labels by which to identify the resource
636
-        :param namespace: namespace of the resource
625
+        Delete resources matching provided resource type, labels, and
626
+        namespace.
637 627
 
638
-        Apply deletion logic based on type of resource
628
+        :param resource_type: type of resource e.g. job, pod, etc.
629
+        :param resource_labels: labels for selecting the resources
630
+        :param namespace: namespace of resources
639 631
         '''
640 632
         timeout = self._check_timeout(wait, timeout)
641 633
 
@@ -710,8 +702,8 @@ class Tiller(object):
710 702
             handled = True
711 703
 
712 704
         if not handled:
713
-            LOG.error("Unable to execute name: %s type: %s ", resource_name,
714
-                      resource_type)
705
+            LOG.error('No resources found with labels=%s type=%s namespace=%s',
706
+                      resource_labels, resource_type, namespace)
715 707
 
716 708
     def rolling_upgrade_pod_deployment(self,
717 709
                                        name,
@@ -760,8 +752,6 @@ class Tiller(object):
760 752
 
761 753
                     # delete pods
762 754
                     self.delete_resources(
763
-                        release_name,
764
-                        name,
765 755
                         'pod',
766 756
                         resource_labels,
767 757
                         namespace,

Loading…
Cancel
Save