@@ -78,7 +78,7 @@ verify_cordon() {
7878 echo " "
7979
8080 # Poll for cordon status with retries
81- local max_attempts=7 # 7 attempts x 3 seconds = 21 seconds
81+ local max_attempts=7 # 7 attempts, 3s apart = ~18 seconds
8282 local attempt=1
8383 local is_unschedulable=" false"
8484
@@ -106,13 +106,17 @@ verify_cordon() {
106106 (( attempt++ ))
107107 done
108108
109- if [ " $is_unschedulable " = " true" ]; then
109+ # Capture the target node's result before $is_unschedulable is reused
110+ # by the all-nodes summary loop further down.
111+ local cordon_verified=" $is_unschedulable "
112+
113+ if [ " $cordon_verified " = " true" ]; then
110114 echo " 🔒 No new pods will be scheduled on this node"
111115 echo " ✅ Existing workloads continue running (safe mode)"
112116 echo " 🎯 NVSentinel successfully quarantined the faulty node!"
113117 echo " "
114118 else
115- warn " Node $TARGET_NODE is NOT cordoned yet "
119+ warn " Node $TARGET_NODE was not cordoned after $max_attempts attempts "
116120 echo " "
117121 echo " This could mean:"
118122 echo " - The event is still being processed (wait a few seconds)"
@@ -177,6 +181,20 @@ verify_cordon() {
177181 fi
178182 done
179183
184+ if [ " $cordon_verified " != " true" ]; then
185+ section " Demo Incomplete"
186+
187+ echo " The node was not cordoned, so the demo did not complete successfully."
188+ echo " "
189+ echo " Most common cause is insufficient resources - fault-quarantine needs"
190+ echo " MongoDB to hold primary in order to watch the change stream. Check with:"
191+ echo " kubectl get pods -n $NAMESPACE "
192+ echo " "
193+ echo " When you're done, clean up: ./scripts/99-cleanup.sh"
194+ echo " "
195+ return 1
196+ fi
197+
180198 section " Demo Complete! 🎉"
181199
182200 echo " You've successfully completed the NVSentinel local demo!"
0 commit comments