Commit 405dcf1
committed
(bug) Fix HelmReleaseSummary.FailureMessage never persisted after chart deployment failure
When a Helm chart deployment fails, setHelmFailureMessageOnHelmChartSummary correctly sets FailureMessage on
clusterSummary.Status.HelmReleaseSummaries[i] in memory, but this value was never written back to the API server.
The root cause is a sequencing issue: updateStatusForReferencedHelmReleases (which persists HelmReleaseSummaries)
runs before walkChartsAndDeploy. After walkChartsAndDeploy fails and sets the FailureMessage in memory,
updateStatusForNonReferencedHelmReleases then re-fetches a fresh ClusterSummary from the API and overwrites the status,
so discarding the in-memory change entirely.
As a result, HelmReleaseSummaries[].FailureMessage always remained empty even after repeated failures,
while featureSummaries[].failureMessage (set through a separate path) correctly reflected the error.
A secondary bug: setHelmFailureMessageOnHelmChartSummary was passed currentChart (the raw, pre-template spec) instead of
instantiatedChart. The lookup compares ReleaseName/ReleaseNamespace against values stored in HelmReleaseSummaries, which
are the instantiated values. When those fields contain Go templates, the lookup would silently find no match and the
FailureMessage would not be set at all.
Fix consist in:
1. Pass instantiatedChart (post-template) instead of currentChart to setHelmFailureMessageOnHelmChartSummary so the lookup
always matches what is stored in HelmReleaseSummaries.
2. In updateStatusForNonReferencedHelmReleases, before overwriting the status with the freshly fetched ClusterSummary, build
an index of the in-memory FailureMessage values set by walkChartsAndDeploy and merge them into the entries being written. This
ensures the failure from the current reconciliation round is persisted to the API.1 parent cb914ec commit 405dcf1
1 file changed
+14
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | | - | |
| 1012 | + | |
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
| |||
2729 | 2729 | | |
2730 | 2730 | | |
2731 | 2731 | | |
| 2732 | + | |
| 2733 | + | |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
2732 | 2740 | | |
2733 | 2741 | | |
2734 | 2742 | | |
2735 | 2743 | | |
2736 | | - | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
2737 | 2749 | | |
2738 | 2750 | | |
2739 | 2751 | | |
| |||
0 commit comments