Commit fea4a6f
authored
fix: support Kubernetes 1.21 by handling missing availableReplicas field (#950)
The operator claims to support Kubernetes 1.21+ but fails to set
RisingWave clusters to running=true on K8s 1.21.
Root cause: The availableReplicas field was added to StatefulSet
in Kubernetes 1.22 as an alpha feature (KEP-2599). On K8s 1.21,
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 while maintaining optimal behavior on K8s 1.22+.
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: #9491 parent bce1c4e commit fea4a6f
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