bug(manifest): Allow specific manifest to be specified

This PS allows users to specify the manifest file to use
by the Armada handler by introducing a new flag called
`target_manifest`. This flag was added to the API and
CLI.

A foundation of unit tests for the manifest handler
is included in this PS. Most of the coverage is aimed
at checking the various success and failure cases
surrounding the new target_manifest feature.

Also updates documentation to convey information about
the new flag and clean up some documentation formatting
inconsistencies and typos.

Change-Id: I1d5a3ecc1e99b6479438d0ee5490610178be34fe
This commit is contained in:
Felipe Monteiro
2018-01-22 21:44:30 +00:00
parent 62338b394f
commit 093b5d2296
18 changed files with 634 additions and 139 deletions

View File

@@ -54,10 +54,23 @@ class Armada(object):
timeout=DEFAULT_TIMEOUT,
tiller_host=None,
tiller_port=44134,
values=None):
values=None,
target_manifest=None):
'''
Initialize the Armada Engine and establish
a connection to Tiller
Initialize the Armada engine and establish a connection to Tiller.
:param List[dict] file: Armada documents.
:param bool disable_update_pre: Disable pre-update Tiller operations.
:param bool disable_update_post: Disable post-update Tiller
operations.
:param bool enable_chart_cleanup: Clean up unmanaged charts.
:param bool dry_run: Run charts without installing them.
:param bool wait: Wait until all charts are deployed.
:param int timeout: Specifies time to wait for charts to deploy.
:param str tiller_host: Tiller host IP.
:param int tiller_port: Tiller host port.
:param str target_manifest: The target manifest to run. Useful for
specifying which manifest to run when multiple are available.
'''
self.disable_update_pre = disable_update_pre
self.disable_update_post = disable_update_post
@@ -70,9 +83,13 @@ class Armada(object):
self.values = values
self.documents = file
self.config = None
self.target_manifest = target_manifest
def get_armada_manifest(self):
return Manifest(self.documents).get_manifest()
return Manifest(
self.documents,
target_manifest=self.target_manifest
).get_manifest()
def find_release_chart(self, known_releases, name):
'''
@@ -303,7 +320,7 @@ class Armada(object):
timeout=chart_timeout)
if chart_wait:
# TODO(gardlt): after v0.7.1 depricate timeout values
# TODO(gardlt): after v0.7.1 deprecate timeout values
if not wait_values.get('timeout', None):
wait_values['timeout'] = chart_timeout