[WIP]: Support reading dependencies from chart
Change-Id: Ifc541dc273fa2a5c5b4e43125f468ea3fdb0f379
This commit is contained in:
parent
77deecc294
commit
5738a4ced0
|
@ -242,11 +242,29 @@ class ChartBuilder(object):
|
|||
return self._helm_chart
|
||||
|
||||
dependencies = []
|
||||
chart_dependencies = self.chart_data.get('dependencies', [])
|
||||
chart_dependencies = self.chart_data.get('dependencies')
|
||||
|
||||
# Chart dependencies are not specified, read them out of the chart.
|
||||
if chart_dependencies is None:
|
||||
chart_dependencies = []
|
||||
charts_dir = os.path.join(self.source_directory, 'charts')
|
||||
if os.path.isdir(charts_dir):
|
||||
for item in os.listdir(charts_dir):
|
||||
dep_chart = {
|
||||
'metadata': {
|
||||
'name': item
|
||||
},
|
||||
const.KEYWORD_DATA: {
|
||||
'source_dir': os.path.join(charts_dir, item)
|
||||
}
|
||||
}
|
||||
chart_dependencies.append(dep_chart)
|
||||
|
||||
chart_name = self.chart['metadata']['name']
|
||||
chart_release = self.chart_data.get('release', None)
|
||||
for dep_chart in chart_dependencies:
|
||||
dep_chart_name = dep_chart['metadata']['name']
|
||||
# TODO: chart_release can be None, should log dependency chain instead.
|
||||
LOG.info(
|
||||
"Building dependency chart %s for release %s.", dep_chart_name,
|
||||
chart_release)
|
||||
|
|
|
@ -52,9 +52,15 @@ Chart
|
|||
| ``upgrade.options.no_hooks``, | |
|
||||
| and now optional | |
|
||||
+--------------------------------+------------------------------------------------------------+
|
||||
| ``dependencies``, | Remove as desired. |
|
||||
| ``source.subpath`` | |
|
||||
| now optional | |
|
||||
| ``dependencies`` now | Remove if you want to use the dependencies already built |
|
||||
| optional, defaults to using | into the chart. |
|
||||
| any dependencies built into | |
|
||||
| `charts` dir of the `source` | |
|
||||
| helm chart, as Helm CLI does. | |
|
||||
+--------------------------------+------------------------------------------------------------+
|
||||
| ``source.subpath`` | Remove as desired. |
|
||||
| now optional, deafults to no | |
|
||||
| subpath. | |
|
||||
+--------------------------------+------------------------------------------------------------+
|
||||
| ``wait`` improvements | See `Wait Improvements`_. |
|
||||
+--------------------------------+------------------------------------------------------------+
|
||||
|
|
|
@ -121,7 +121,9 @@ Chart
|
|||
+-----------------+----------+---------------------------------------------------------------------------------------+
|
||||
| source | object | provide a path to a ``git repo``, ``local dir``, or ``tarball url`` chart |
|
||||
+-----------------+----------+---------------------------------------------------------------------------------------+
|
||||
| dependencies | object | (optional) reference any chart dependencies before install |
|
||||
| dependencies | object | (optional) reference any chart dependencies before install. |
|
||||
| | | Defaults to using the dependencies already built into the `charts` dir of the |
|
||||
| | | `source` chart, as the Helm CLI does. |
|
||||
+-----------------+----------+---------------------------------------------------------------------------------------+
|
||||
|
||||
.. _wait_v2:
|
||||
|
@ -574,4 +576,4 @@ References
|
|||
~~~~~~~~~~
|
||||
|
||||
For working examples please check the examples in our repo
|
||||
`here <https://opendev.org/airship/armada/src/branch/master/examples>`__.
|
||||
`here <https://github.com/openstack/airship-armada/tree/master/examples>`__
|
||||
|
|
Loading…
Reference in New Issue