Commit 9488e3f
committed
Fix Healthy condition not updating from Ironic health data
Three bugs prevented the Healthy condition from working correctly
on provisioned hosts:
1. computeConditions was only called inside the actResult.Dirty()
block. For steady-state provisioned hosts where nothing changes
during reconciliation, conditions were never recomputed. This
meant the Healthy condition (populated from Ironic's health
monitoring API) stayed at its initial Unknown value forever,
since health status changes externally in Ironic and doesn't
trigger state machine transitions.
2. Empty health from GetHealth (e.g. when the node is not yet
registered) was treated as "unknown" via the default switch
case, overwriting a previously valid Healthy=True on every idle
reconcile. Now empty health means "no data, leave the existing
condition unchanged" — only non-empty values from Ironic update
the condition.
3. conditionsBefore used a slice reference sharing the same backing
array as host.Status.Conditions. In-place modifications by
conditions.Set were visible through both references, making
reflect.DeepEqual always return true. Deep copy the slice before
comparing so condition-only changes trigger a status save.
Also suppress ErrNeedsRegistration log noise in GetHealth, which
fires on every reconcile before the node is registered in Ironic.
Assisted-By: Claude Opus 4.6
Signed-off-by: Jacob Anders <jacob-anders-dev@proton.me>
(cherry picked from commit 0f32c4f)1 parent fb6a6d5 commit 9488e3f
File tree
3 files changed
+41
-21
lines changed- internal/controller/metal3.io
- pkg/provisioner/ironic
3 files changed
+41
-21
lines changedLines changed: 21 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
243 | 252 | | |
244 | 253 | | |
245 | 254 | | |
246 | 255 | | |
247 | | - | |
248 | | - | |
| 256 | + | |
249 | 257 | | |
250 | 258 | | |
251 | 259 | | |
252 | | - | |
253 | 260 | | |
254 | 261 | | |
255 | 262 | | |
| |||
2304 | 2311 | | |
2305 | 2312 | | |
2306 | 2313 | | |
2307 | | - | |
2308 | | - | |
2309 | | - | |
2310 | | - | |
2311 | | - | |
2312 | | - | |
2313 | | - | |
2314 | | - | |
2315 | | - | |
| 2314 | + | |
| 2315 | + | |
| 2316 | + | |
| 2317 | + | |
| 2318 | + | |
| 2319 | + | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
| 2324 | + | |
2316 | 2325 | | |
2317 | 2326 | | |
2318 | 2327 | | |
| |||
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3187 | 3187 | | |
3188 | 3188 | | |
3189 | 3189 | | |
3190 | | - | |
3191 | | - | |
3192 | | - | |
3193 | | - | |
3194 | | - | |
3195 | | - | |
3196 | 3190 | | |
3197 | 3191 | | |
3198 | 3192 | | |
| |||
3232 | 3226 | | |
3233 | 3227 | | |
3234 | 3228 | | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
3235 | 3240 | | |
3236 | 3241 | | |
3237 | 3242 | | |
| |||
3331 | 3336 | | |
3332 | 3337 | | |
3333 | 3338 | | |
3334 | | - | |
3335 | | - | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
3336 | 3345 | | |
3337 | 3346 | | |
3338 | 3347 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2004 | 2004 | | |
2005 | 2005 | | |
2006 | 2006 | | |
2007 | | - | |
| 2007 | + | |
| 2008 | + | |
| 2009 | + | |
2008 | 2010 | | |
2009 | 2011 | | |
2010 | 2012 | | |
| |||
0 commit comments