Commit cd94a73
BUG/MINOR: service: ExternalName backend resolution bypassed by orphan EndpointSlices
When a Kubernetes service transitions from ClusterIP to ExternalName type,
orphan EndpointSlices from the previous ClusterIP state are not cleaned up
by Kubernetes (known behavior). These orphan slices populate HAProxyRuntime
for the service, causing getRuntimeBackend() to skip the ExternalName path
and proceed to port name matching instead.
Port matching then fails because the orphan EndpointSlice carries a named
port (e.g. "http") while the ExternalName service spec has no named port,
resulting in a routing error instead of the expected DNS-based server entry.
Fix by checking s.resource.DNS before consulting HAProxyRuntime: an
ExternalName service must always resolve via getExternalNameEndpoints(),
regardless of any EndpointSlices that may exist in the cluster.1 parent cba5041 commit cd94a73
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
166 | 169 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
0 commit comments