Skip to content

Commit b7db5cb

Browse files
authored
Merge pull request #219 from ordovicia/emit-healthcheck-when-was-unready
Emit healthcheck event when Kustomization was not ready
2 parents 37e1c98 + 8b132d1 commit b7db5cb

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)