From a45c9d1ba0b7b26feb2a281a339c482309490305 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Sun, 3 Apr 2022 19:11:34 +0000 Subject: [PATCH] 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 Change-Id: I08060f66e784eea29af0c97e18bacf14adf7dcf4 --- .../source-debian/helm.py.patched | 56 +++++++++++-------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/tools/debian-integration/source-debian/helm.py.patched b/tools/debian-integration/source-debian/helm.py.patched index 3233ab9f..d16c6897 100644 --- a/tools/debian-integration/source-debian/helm.py.patched +++ b/tools/debian-integration/source-debian/helm.py.patched @@ -709,7 +709,8 @@ class HelmOperator(object): cnamespace=None, armada_format=False, armada_chart_info=None, - combined=False): + combined=False, + is_fluxcd_app=False): """Create the system overrides files for a supported application This method will generate system helm chart overrides yaml files for a @@ -728,18 +729,24 @@ class HelmOperator(object): overrides :param combined: (optional) whether to apply user overrides on top of 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) - # 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) + if is_fluxcd_app: + armada_format = False + + 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: app_overrides = self._get_helm_application_overrides(plugin_name, @@ -790,17 +797,19 @@ class HelmOperator(object): overrides[key] = new_overrides self._write_chart_overrides(path, chart_name, cnamespace, overrides) - # Update manifest docs based on the plugin directives. If the - # application does not provide a manifest operator, the - # GenericArmadaManifestOperator is used and chart specific - # operations can be skipped. - if manifest_op.APP: - if chart_name in self.chart_operators: - self.chart_operators[chart_name].execute_manifest_updates( - manifest_op) + if not is_fluxcd_app: + # Update manifest docs based on the plugin directives. If the + # application does not provide a manifest operator, the + # GenericArmadaManifestOperator is used and chart specific + # operations can be skipped. + if manifest_op.APP: + if chart_name in self.chart_operators: + self.chart_operators[chart_name].execute_manifest_updates( + manifest_op) - # Update the manifest based on platform conditions - manifest_op.platform_mode_manifest_updates(self.dbapi, mode) + if not is_fluxcd_app: + # Update the manifest based on platform conditions + manifest_op.platform_mode_manifest_updates(self.dbapi, mode) else: # Generic applications @@ -842,11 +851,12 @@ class HelmOperator(object): self._write_chart_overrides(path, chart.name, cnamespace, user_overrides) - # Write the manifest doc overrides, a summmary file for easy --value - # generation on the apply, and a unified manifest for deletion. - manifest_op.save_overrides() - manifest_op.save_summary(path=path) - manifest_op.save_delete_manifest() + if not is_fluxcd_app: + # Write the manifest doc overrides, a summmary file for easy --value + # generation on the apply, and a unified manifest for deletion. + manifest_op.save_overrides() + manifest_op.save_summary(path=path) + manifest_op.save_delete_manifest() def _find_kube_app_and_app_plugin_name(self, app_name): return utils.find_kube_app(self.dbapi, app_name), \