Debian: Update patched helm.py

The patched helm.py file is based off some custom
modifications to helm.py.

The helm.py in sysinv changes recently, so those
changes needed to be propagated to the patched file
for debian bootstrap to succeed with recent
fluxcd changes

Task: 44830
Story: 2009138
Signed-off-by: Al Bailey <al.bailey@windriver.com>
Change-Id: I08060f66e784eea29af0c97e18bacf14adf7dcf4
This commit is contained in:
Al Bailey 2022-04-03 19:11:34 +00:00
parent 68ceaddca5
commit a45c9d1ba0

View File

@ -709,7 +709,8 @@ class HelmOperator(object):
cnamespace=None, cnamespace=None,
armada_format=False, armada_format=False,
armada_chart_info=None, armada_chart_info=None,
combined=False): combined=False,
is_fluxcd_app=False):
"""Create the system overrides files for a supported application """Create the system overrides files for a supported application
This method will generate system helm chart overrides yaml files for a This method will generate system helm chart overrides yaml files for a
@ -728,18 +729,24 @@ class HelmOperator(object):
overrides overrides
:param combined: (optional) whether to apply user overrides on top of :param combined: (optional) whether to apply user overrides on top of
system overrides system overrides
:param is_fluxcd_app: whether the app is fluxcd or not
""" """
app, plugin_name = self._find_kube_app_and_app_plugin_name(app_name) app, plugin_name = self._find_kube_app_and_app_plugin_name(app_name)
# Get a manifest operator to provide a single point of if is_fluxcd_app:
# manipulation for the chart, chart group and manifest schemas armada_format = False
manifest_op = self.get_armada_manifest_operator(app.name)
else:
# Get a manifest operator to provide a single point of
# manipulation for the chart, chart group and manifest schemas
manifest_op = self.get_armada_manifest_operator(app.name)
# Load the manifest into the operator
armada_manifest = utils.generate_synced_armada_manifest_fqpn(
app.name, app.app_version, app.manifest_file)
manifest_op.load(armada_manifest)
# Load the manifest into the operator
armada_manifest = utils.generate_synced_armada_manifest_fqpn(
app.name, app.app_version, app.manifest_file)
manifest_op.load(armada_manifest)
if plugin_name in self.helm_system_applications: if plugin_name in self.helm_system_applications:
app_overrides = self._get_helm_application_overrides(plugin_name, app_overrides = self._get_helm_application_overrides(plugin_name,
@ -790,17 +797,19 @@ class HelmOperator(object):
overrides[key] = new_overrides overrides[key] = new_overrides
self._write_chart_overrides(path, chart_name, cnamespace, overrides) self._write_chart_overrides(path, chart_name, cnamespace, overrides)
# Update manifest docs based on the plugin directives. If the if not is_fluxcd_app:
# application does not provide a manifest operator, the # Update manifest docs based on the plugin directives. If the
# GenericArmadaManifestOperator is used and chart specific # application does not provide a manifest operator, the
# operations can be skipped. # GenericArmadaManifestOperator is used and chart specific
if manifest_op.APP: # operations can be skipped.
if chart_name in self.chart_operators: if manifest_op.APP:
self.chart_operators[chart_name].execute_manifest_updates( if chart_name in self.chart_operators:
manifest_op) self.chart_operators[chart_name].execute_manifest_updates(
manifest_op)
# Update the manifest based on platform conditions if not is_fluxcd_app:
manifest_op.platform_mode_manifest_updates(self.dbapi, mode) # Update the manifest based on platform conditions
manifest_op.platform_mode_manifest_updates(self.dbapi, mode)
else: else:
# Generic applications # Generic applications
@ -842,11 +851,12 @@ class HelmOperator(object):
self._write_chart_overrides(path, chart.name, self._write_chart_overrides(path, chart.name,
cnamespace, user_overrides) cnamespace, user_overrides)
# Write the manifest doc overrides, a summmary file for easy --value if not is_fluxcd_app:
# generation on the apply, and a unified manifest for deletion. # Write the manifest doc overrides, a summmary file for easy --value
manifest_op.save_overrides() # generation on the apply, and a unified manifest for deletion.
manifest_op.save_summary(path=path) manifest_op.save_overrides()
manifest_op.save_delete_manifest() manifest_op.save_summary(path=path)
manifest_op.save_delete_manifest()
def _find_kube_app_and_app_plugin_name(self, app_name): def _find_kube_app_and_app_plugin_name(self, app_name):
return utils.find_kube_app(self.dbapi, app_name), \ return utils.find_kube_app(self.dbapi, app_name), \