Commit d7d0c01
committed
Add validation and improved logging for PVC storage configuration
Prevents silent failures when override.statefulSet.spec.volumeClaimTemplates is provided with only metadata (e.g., annotations) but missing the required spec.resources.requests.storage field.
Changes:
1. Add CRD validation requiring PVC spec field
- Kubernetes API server now rejects incomplete volumeClaimTemplates
- Users get immediate feedback instead of silent reconciliation failures
2. Improve error messages at reconciliation time
- Detect storage=0 with helpful hint about override behavior
- Show actual values in shrink error: \"(existing: 20Gi, desired: 5Gi)\"
- Explain that overrides replace entire templates, not merge
Files Modified:
- api/v1beta1/rabbitmqcluster_types.go - Add validation marker
- config/crd/bases/rabbitmq.com_rabbitmqclusters.yaml - Generated CRD
- controllers/reconcile_persistence.go - Validate storage != 0
- internal/scaling/scaling.go - Add storage=0 check with helpful error
Fixes: #20231 parent e4c7b88 commit d7d0c01
File tree
4 files changed
+31
-25
lines changed- api/v1beta1
- config/crd/bases
- controllers
- internal/scaling
4 files changed
+31
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
356 | 358 | | |
357 | 359 | | |
358 | 360 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5059 | 5059 | | |
5060 | 5060 | | |
5061 | 5061 | | |
| 5062 | + | |
| 5063 | + | |
5062 | 5064 | | |
5063 | 5065 | | |
5064 | 5066 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
24 | 30 | | |
25 | 31 | | |
26 | 32 | | |
27 | | - | |
| 33 | + | |
28 | 34 | | |
29 | 35 | | |
30 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
31 | 45 | | |
32 | 46 | | |
33 | | - | |
| 47 | + | |
34 | 48 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
67 | 55 | | |
68 | 56 | | |
69 | 57 | | |
| |||
0 commit comments