fix(tiller): pre-delete-actions

- selecting when to wait for redeployment

Change-Id: Ie7746443946ec05c6a4daaca07cfc741b9194de9
This commit is contained in:
gardlt 2017-11-03 19:37:15 +00:00
parent 7b26e59422
commit 1a0c33c818
2 changed files with 13 additions and 8 deletions

View File

@ -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)

View File

@ -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: