bug(wait): fixing how we wait on chart and group
- added abilty to choose labels to wait on - created wait object Change-Id: Ia3b6f7bd7b6ef15779b087c613d69f4f6a7b41e9
This commit is contained in:
@@ -213,8 +213,8 @@ class Armada(object):
|
||||
release[1])
|
||||
|
||||
for entry in self.config[const.KEYWORD_ARMADA][const.KEYWORD_GROUPS]:
|
||||
chart_wait = self.wait
|
||||
|
||||
chart_wait = self.wait
|
||||
desc = entry.get('description', 'A Chart Group')
|
||||
chart_group = entry.get(const.KEYWORD_CHARTS, [])
|
||||
test_charts = entry.get('test_charts', False)
|
||||
@@ -227,6 +227,7 @@ class Armada(object):
|
||||
for gchart in chart_group:
|
||||
chart = dotify(gchart['chart'])
|
||||
values = gchart.get('chart').get('values', {})
|
||||
wait_values = gchart.get('chart').get('wait', {})
|
||||
test_chart = gchart.get('chart').get('test', False)
|
||||
pre_actions = {}
|
||||
post_actions = {}
|
||||
@@ -242,7 +243,7 @@ class Armada(object):
|
||||
if chart_wait:
|
||||
if chart_timeout == DEFAULT_TIMEOUT:
|
||||
chart_timeout = getattr(
|
||||
chart, 'timeout', DEFAULT_TIMEOUT)
|
||||
chart, 'timeout', chart_timeout)
|
||||
|
||||
chartbuilder = ChartBuilder(chart)
|
||||
protoc_chart = chartbuilder.get_helm_chart()
|
||||
@@ -302,10 +303,16 @@ class Armada(object):
|
||||
timeout=chart_timeout)
|
||||
|
||||
if chart_wait:
|
||||
# TODO(gardlt): after v0.7.1 depricate timeout values
|
||||
if not wait_values.get('timeout', None):
|
||||
wait_values['timeout'] = chart_timeout
|
||||
|
||||
self.tiller.k8s.wait_until_ready(
|
||||
release=prefix_chart,
|
||||
labels=wait_values.get('labels', ''),
|
||||
namespace=chart.namespace,
|
||||
timeout=chart_timeout)
|
||||
timeout=wait_values.get('timeout', DEFAULT_TIMEOUT)
|
||||
)
|
||||
|
||||
msg['upgraded'].append(prefix_chart)
|
||||
|
||||
@@ -322,10 +329,14 @@ class Armada(object):
|
||||
timeout=chart_timeout)
|
||||
|
||||
if chart_wait:
|
||||
if not wait_values.get('timeout', None):
|
||||
wait_values['timeout'] = chart_timeout
|
||||
|
||||
self.tiller.k8s.wait_until_ready(
|
||||
release=prefix_chart,
|
||||
labels=wait_values.get('labels', ''),
|
||||
namespace=chart.namespace,
|
||||
timeout=chart_timeout)
|
||||
timeout=wait_values.get('timeout', 3600))
|
||||
|
||||
msg['installed'].append(prefix_chart)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user