Prevent HelmChart controller panic on init failure

The controller logic is a serious candidate to be refactored so that
errors can be taken into account better, and do not always result in a
requeue. But this will do for the time being.

Signed-off-by: Hidde Beydals <hello@hidde.co>
This commit is contained in:
Hidde Beydals 2020-12-16 15:07:28 +01:00
parent 29a051c5f4
commit 7cefdee6d8
1 changed files with 2 additions and 2 deletions

View File

@ -188,8 +188,8 @@ func (r *HelmChartReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
}
// Emit an event if we did not have an artifact before, or the revision has changed
if (chart.Status.Artifact == nil && reconciledChart.Status.Artifact != nil) ||
reconciledChart.Status.Artifact.Revision != chart.Status.Artifact.Revision {
if (chart.GetArtifact() == nil && reconciledChart.GetArtifact() != nil) ||
(chart.GetArtifact() != nil && reconciledChart.GetArtifact() != nil && reconciledChart.GetArtifact().Revision != chart.GetArtifact().Revision) {
r.event(reconciledChart, events.EventSeverityInfo, sourcev1.HelmChartReadyMessage(reconciledChart))
}
r.recordReadiness(reconciledChart)