[Bug] Update default timeout and logic
- Change default timeout to 3600 - Timeout specified with CLI has priority - Timeout specified with yaml has second priority
This commit is contained in:
parent
38746c35a7
commit
62c05f569a
|
@ -27,6 +27,7 @@ from ..utils import lint
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
DEFAULT_TIMEOUT = 3600
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
DOMAIN = "armada"
|
DOMAIN = "armada"
|
||||||
|
|
||||||
|
@ -45,7 +46,7 @@ class Armada(object):
|
||||||
skip_pre_flight=False,
|
skip_pre_flight=False,
|
||||||
dry_run=False,
|
dry_run=False,
|
||||||
wait=False,
|
wait=False,
|
||||||
timeout=None,
|
timeout=DEFAULT_TIMEOUT,
|
||||||
debug=False):
|
debug=False):
|
||||||
'''
|
'''
|
||||||
Initialize the Armada Engine and establish
|
Initialize the Armada Engine and establish
|
||||||
|
@ -131,12 +132,11 @@ class Armada(object):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# retrieve appropriate timeout value if 'wait' is specified
|
# retrieve appropriate timeout value if 'wait' is specified
|
||||||
chart_timeout = None
|
chart_timeout = self.timeout
|
||||||
if chart_wait:
|
if chart_wait:
|
||||||
if getattr(chart, 'timeout', None):
|
if chart_timeout == DEFAULT_TIMEOUT:
|
||||||
chart_timeout = chart.timeout
|
chart_timeout = getattr(chart, 'timeout',
|
||||||
else:
|
chart_timeout)
|
||||||
chart_timeout = self.timeout
|
|
||||||
|
|
||||||
chartbuilder = ChartBuilder(chart)
|
chartbuilder = ChartBuilder(chart)
|
||||||
protoc_chart = chartbuilder.get_helm_chart()
|
protoc_chart = chartbuilder.get_helm_chart()
|
||||||
|
|
|
@ -52,7 +52,7 @@ class ArmadaTestCase(unittest.TestCase):
|
||||||
armada = Armada('',
|
armada = Armada('',
|
||||||
skip_pre_flight=True,
|
skip_pre_flight=True,
|
||||||
wait=True,
|
wait=True,
|
||||||
timeout=None)
|
timeout=1000)
|
||||||
armada.tiller = mock_tiller
|
armada.tiller = mock_tiller
|
||||||
armada.config = yaml.load(self.test_yaml)
|
armada.config = yaml.load(self.test_yaml)
|
||||||
|
|
||||||
|
@ -75,14 +75,14 @@ class ArmadaTestCase(unittest.TestCase):
|
||||||
armada.config['armada']['release_prefix'],
|
armada.config['armada']['release_prefix'],
|
||||||
values=yaml.safe_dump(chart_1['values']),
|
values=yaml.safe_dump(chart_1['values']),
|
||||||
wait=armada.wait,
|
wait=armada.wait,
|
||||||
timeout=chart_1['timeout']),
|
timeout=1000),
|
||||||
mock.call(mock_chartbuilder().get_helm_chart(),
|
mock.call(mock_chartbuilder().get_helm_chart(),
|
||||||
armada.dry_run, chart_2['release_name'],
|
armada.dry_run, chart_2['release_name'],
|
||||||
chart_2['namespace'],
|
chart_2['namespace'],
|
||||||
armada.config['armada']['release_prefix'],
|
armada.config['armada']['release_prefix'],
|
||||||
values=yaml.safe_dump(chart_2['values']),
|
values=yaml.safe_dump(chart_2['values']),
|
||||||
wait=armada.wait,
|
wait=armada.wait,
|
||||||
timeout=chart_2['timeout'])]
|
timeout=1000)]
|
||||||
mock_tiller.install_release.assert_has_calls(method_calls)
|
mock_tiller.install_release.assert_has_calls(method_calls)
|
||||||
|
|
||||||
@unittest.skip('skipping update')
|
@unittest.skip('skipping update')
|
||||||
|
|
Loading…
Reference in New Issue