Commit 6ac0ca0
committed
fix: support Kubernetes 1.21-1.26 by handling missing availableReplicas field
The operator claims to support Kubernetes 1.21+ but fails to set
RisingWave clusters to running=true on K8s versions 1.21-1.26.
Root cause: The availableReplicas field was added to StatefulSet
in Kubernetes 1.27 (KEP-3017). On older versions, this field doesn't
exist and defaults to 0, causing readiness checks to always fail.
Solution: Fall back to readyReplicas (available since K8s 1.9) when
availableReplicas is not available. This ensures backward compatibility
with K8s 1.21-1.26 while maintaining optimal behavior on K8s 1.27+.
Changes:
- pkg/utils/apps.go: Add fallback logic in IsStatefulSetRolledOut()
- pkg/utils/apps.go: Add fallback logic in IsAdvancedStatefulSetRolledOut()
Tested on Kubernetes 1.21.13 - clusters now correctly show running=true.
Fixes: #XXX1 parent bce1c4e commit 6ac0ca0
1 file changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
| |||
135 | 143 | | |
136 | 144 | | |
137 | 145 | | |
138 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
139 | 154 | | |
140 | 155 | | |
141 | 156 | | |
| |||
0 commit comments