Commit 98a34f7
authored
fix: surface ValkeyNode reconcile errors in status conditions (#257)
## Summary
When `ensureConfigMap`, `ensurePersistentVolumeClaim`, or
`ensureWorkload` fails during ValkeyNode reconciliation, the controller
returns the error to controller-runtime without updating the ValkeyNode
status. This leaves the resource with no visible indication of why it is
stuck other than the operator logs.
Found during testing where a PVC quota exceeded error left a ValkeyNode
with a completely empty status section.
## Implementation
Add a `setReadyCondition` helper that patches the ValkeyNode Ready
condition to False with the error reason before returning. Reasons are
specific to the failing stage: `ConfigMapError`,
`PersistentVolumeClaimError`, `StatefulSetError`, or `DeploymentError`.
The condition is self-clearing: once the error resolves, the existing
`updateStatus` path overwrites it with the healthy state.
## Limitations
Does not cover the `reconcilePersistenceFinalizer` early-return path, ok
to me for now.
## Testing
Unit tests pass. Verified manually by triggering a PVC quota error on an
ENG cluster:
```
༼ つ ▀_▀ ༽つ ~ src valkey-ope kubectl describe valkeynode eng-test-3-0 -n valkey-operator | tail -15
Tolerations:
Effect: NoSchedule
Key: dedicated
Value: openebs
Users ACL Secret Name: internal-eng-test-acl
Workload Type: StatefulSet
Status:
Conditions:
Last Transition Time: 2026-06-17T13:21:49Z
Message: persistentvolumeclaims "valkey-eng-test-3-0-data" is forbidden: exceeded quota: fuze-quota, requested: persistentvolumeclaims=1, used: persistentvolumeclaims=12, limited: persistentvolumeclaims=12
Observed Generation: 1
Reason: PersistentVolumeClaimError
Status: False
Type: Ready
```
Signed-off-by: Daan Vinken <daanvinken@tythus.com>1 parent 3a01229 commit 98a34f7
1 file changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
| |||
212 | 222 | | |
213 | 223 | | |
214 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
215 | 251 | | |
216 | 252 | | |
217 | 253 | | |
| |||
0 commit comments