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
This commit is contained in:
Drew Walters 2018-11-12 20:36:36 +00:00
parent 4b76fda6b4
commit 5cafd027b5
1 changed files with 8 additions and 18 deletions

View File

@ -328,12 +328,7 @@ class Tiller(object):
labels = action.get('labels', None) labels = action.get('labels', None)
self.delete_resources( self.delete_resources(
release_name, action_type, labels, namespace, timeout=timeout)
name,
action_type,
labels,
namespace,
timeout=timeout)
except Exception: except Exception:
LOG.excpetion( LOG.excpetion(
"Pre-action failure: could not delete %(res_type)s " "Pre-action failure: could not delete %(res_type)s "
@ -621,21 +616,18 @@ class Tiller(object):
raise ex.ReleaseException(release, status, 'Delete') raise ex.ReleaseException(release, status, 'Delete')
def delete_resources(self, def delete_resources(self,
release_name,
resource_name,
resource_type, resource_type,
resource_labels, resource_labels,
namespace, namespace,
wait=False, wait=False,
timeout=const.DEFAULT_TILLER_TIMEOUT): timeout=const.DEFAULT_TILLER_TIMEOUT):
''' '''
:param release_name: release name the specified resource is under Delete resources matching provided resource type, labels, and
:param resource_name: name of specific resource namespace.
:param resource_type: type of resource e.g. job, pod, etc.
:param resource_labels: labels by which to identify the resource
:param namespace: namespace of the resource
Apply deletion logic based on type of resource :param resource_type: type of resource e.g. job, pod, etc.
:param resource_labels: labels for selecting the resources
:param namespace: namespace of resources
''' '''
timeout = self._check_timeout(wait, timeout) timeout = self._check_timeout(wait, timeout)
@ -710,8 +702,8 @@ class Tiller(object):
handled = True handled = True
if not handled: if not handled:
LOG.error("Unable to execute name: %s type: %s ", resource_name, LOG.error('No resources found with labels=%s type=%s namespace=%s',
resource_type) resource_labels, resource_type, namespace)
def rolling_upgrade_pod_deployment(self, def rolling_upgrade_pod_deployment(self,
name, name,
@ -760,8 +752,6 @@ class Tiller(object):
# delete pods # delete pods
self.delete_resources( self.delete_resources(
release_name,
name,
'pod', 'pod',
resource_labels, resource_labels,
namespace, namespace,