Skip to content

Commit

Permalink
fix: use corev1 event type for sending events
Browse files Browse the repository at this point in the history
Signed-off-by: Soule BA <[email protected]>
  • Loading branch information
souleb committed Mar 7, 2024
1 parent b79cad0 commit abf15c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/controller/helmrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, patchHelpe
conditions.MarkStalled(obj, aclv1.AccessDeniedReason, err.Error())
conditions.MarkFalse(obj, meta.ReadyCondition, aclv1.AccessDeniedReason, err.Error())
conditions.Delete(obj, meta.ReconcilingCondition)
r.Eventf(obj, eventv1.EventSeverityError, aclv1.AccessDeniedReason, err.Error())
r.Eventf(obj, corev1.EventTypeWarning, aclv1.AccessDeniedReason, err.Error())

// Recovering from this is not possible without a restart of the
// controller or a change of spec, both triggering a new
Expand Down Expand Up @@ -294,7 +294,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, patchHelpe
values, err := chartutil.ChartValuesFromReferences(ctx, r.Client, obj.Namespace, obj.GetValues(), obj.Spec.ValuesFrom...)
if err != nil {
conditions.MarkFalse(obj, meta.ReadyCondition, "ValuesError", err.Error())
r.Eventf(obj, eventv1.EventSeverityError, "ValuesError", err.Error())
r.Eventf(obj, corev1.EventTypeWarning, "ValuesError", err.Error())
return ctrl.Result{}, err
}
// Remove any stale corresponding Ready=False condition with Unknown.
Expand All @@ -313,7 +313,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, patchHelpe
}

conditions.MarkFalse(obj, meta.ReadyCondition, v2.ArtifactFailedReason, fmt.Sprintf("Could not load chart: %s", err.Error()))
r.Eventf(obj, eventv1.EventSeverityError, v2.ArtifactFailedReason, err.Error())
r.Eventf(obj, corev1.EventTypeWarning, v2.ArtifactFailedReason, err.Error())
return ctrl.Result{}, err
}
// Remove any stale corresponding Ready=False condition with Unknown.
Expand Down

0 comments on commit abf15c1

Please sign in to comment.