From 1a0c33c8183dbae7d2a960415daae7b0e89c286e Mon Sep 17 00:00:00 2001 From: gardlt Date: Fri, 3 Nov 2017 19:37:15 +0000 Subject: [PATCH] fix(tiller): pre-delete-actions - selecting when to wait for redeployment Change-Id: Ie7746443946ec05c6a4daaca07cfc741b9194de9 --- armada/handlers/tiller.py | 14 ++++++++------ examples/keystone-manifest.yaml | 7 +++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/armada/handlers/tiller.py b/armada/handlers/tiller.py index c6decd35..ece4f082 100644 --- a/armada/handlers/tiller.py +++ b/armada/handlers/tiller.py @@ -467,7 +467,7 @@ class Tiller(object): self.uninstall_release(chart) def delete_resources(self, release_name, resource_name, resource_type, - resource_labels, namespace): + resource_labels, namespace, wait=False): ''' :params release_name - release name the specified resource is under :params resource_name - name of specific resource @@ -498,7 +498,8 @@ class Tiller(object): pod_name = pod.metadata.name LOG.info("Deleting %s in namespace: %s", pod_name, namespace) self.k8s.delete_namespace_pod(pod_name, namespace) - self.k8s.wait_for_pod_redeployment(pod_name, namespace) + if wait: + self.k8s.wait_for_pod_redeployment(pod_name, namespace) else: LOG.error("Unable to execute name: %s type: %s ", resource_name, resource_type) @@ -542,8 +543,9 @@ class Tiller(object): namespace=namespace, template=template) # delete pods - self.delete_resources(release_name, name, 'pod', - resource_labels, namespace) + self.delete_resources( + release_name, name, 'pod', resource_labels, namespace, + wait=True) - elif action_type == 'statefulset': - pass + else: + LOG.error("Unable to exectue name: % type: %s", name, action_type) diff --git a/examples/keystone-manifest.yaml b/examples/keystone-manifest.yaml index 38309ea2..73fe7c19 100644 --- a/examples/keystone-manifest.yaml +++ b/examples/keystone-manifest.yaml @@ -23,6 +23,7 @@ data: chart_name: mariadb release: mariadb namespace: openstack + timeout: 3600 wait: timeout: 3600 labels: @@ -48,6 +49,7 @@ data: chart_name: memcached release: memcached namespace: openstack + timeout: 100 wait: timeout: 100 labels: @@ -74,6 +76,7 @@ data: test: true release: keystone namespace: openstack + timeout: 100 wait: timeout: 100 labels: @@ -87,8 +90,8 @@ data: - name: keystone-bootstrap type: job labels: - - application: keystone - - component: bootstrap + application: keystone + component: bootstrap values: replicas: 3 source: