Skip to content

Commit 65e29ca

Browse files
committed
Emit healthcheck event when Kustomization was not ready
1 parent 37e1c98 commit 65e29ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

controllers/kustomization_controller.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,10 @@ func (r *KustomizationReconciler) checkHealth(statusPoller *polling.StatusPoller
815815
return err
816816
}
817817

818-
if kustomization.Status.LastAppliedRevision != revision && changed {
818+
readiness := apimeta.FindStatusCondition(kustomization.Status.Conditions, meta.ReadyCondition)
819+
ready := readiness != nil && readiness.Status == metav1.ConditionTrue
820+
821+
if !ready || (kustomization.Status.LastAppliedRevision != revision && changed) {
819822
r.event(kustomization, revision, events.EventSeverityInfo, "Health check passed", nil)
820823
}
821824
return nil

0 commit comments

Comments
 (0)