Skip to content

Commit 7cefdee

Browse files
committed
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 <[email protected]>
1 parent 29a051c commit 7cefdee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

controllers/helmchart_controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ func (r *HelmChartReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
188188
}
189189

190190
// Emit an event if we did not have an artifact before, or the revision has changed
191-
if (chart.Status.Artifact == nil && reconciledChart.Status.Artifact != nil) ||
192-
reconciledChart.Status.Artifact.Revision != chart.Status.Artifact.Revision {
191+
if (chart.GetArtifact() == nil && reconciledChart.GetArtifact() != nil) ||
192+
(chart.GetArtifact() != nil && reconciledChart.GetArtifact() != nil && reconciledChart.GetArtifact().Revision != chart.GetArtifact().Revision) {
193193
r.event(reconciledChart, events.EventSeverityInfo, sourcev1.HelmChartReadyMessage(reconciledChart))
194194
}
195195
r.recordReadiness(reconciledChart)

0 commit comments

Comments
 (0)